Make programs orthogonal
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
widelands |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
At the moment, our MapObject program syntax is not orthogonal. For example, we have:
"animate=idle 500000",
"animation planting 4000",
So, the programs should be refactored like this:
1. Program names are verbs, so "animation" needs to be replaced by "animate". Update the documentation.
2. Program names are separated from their parameters by =, so together with 1, "animation planting 4000" will become "animate=planting 4000". Update the documentation.
3. We have multiple parser implementations for programs. Create a common object MapObjectProgram. There could also be a separate object MapObjectProgra
4. Programs shared by multiple MapObject types like e.g. "animate" are parsed by MapObjectProgram and run by MapObject.
Related branches
- hessenfarmer: Approve (playtest and review)
-
Diff: 5176 lines (+956/-973)152 files modifieddata/tribes/buildings/productionsites/atlanteans/blackroot_farm/init.lua (+6/-6)
data/tribes/buildings/productionsites/atlanteans/farm/init.lua (+6/-6)
data/tribes/buildings/productionsites/atlanteans/fishbreeders_house/init.lua (+1/-1)
data/tribes/buildings/productionsites/atlanteans/fishers_house/init.lua (+1/-1)
data/tribes/buildings/productionsites/atlanteans/foresters_house/init.lua (+1/-1)
data/tribes/buildings/productionsites/atlanteans/gold_spinning_mill/init.lua (+1/-1)
data/tribes/buildings/productionsites/atlanteans/horsefarm/init.lua (+1/-1)
data/tribes/buildings/productionsites/atlanteans/hunters_house/init.lua (+1/-1)
data/tribes/buildings/productionsites/atlanteans/mill/init.lua (+2/-2)
data/tribes/buildings/productionsites/atlanteans/quarry/init.lua (+1/-1)
data/tribes/buildings/productionsites/atlanteans/sawmill/init.lua (+1/-1)
data/tribes/buildings/productionsites/atlanteans/scouts_house/init.lua (+2/-2)
data/tribes/buildings/productionsites/atlanteans/shipyard/init.lua (+1/-1)
data/tribes/buildings/productionsites/atlanteans/smelting_works/init.lua (+4/-4)
data/tribes/buildings/productionsites/atlanteans/toolsmithy/init.lua (+12/-12)
data/tribes/buildings/productionsites/atlanteans/weaponsmithy/init.lua (+10/-10)
data/tribes/buildings/productionsites/atlanteans/weaving_mill/init.lua (+3/-3)
data/tribes/buildings/productionsites/atlanteans/woodcutters_house/init.lua (+1/-1)
data/tribes/buildings/productionsites/barbarians/ax_workshop/init.lua (+6/-6)
data/tribes/buildings/productionsites/barbarians/big_inn/init.lua (+3/-3)
data/tribes/buildings/productionsites/barbarians/cattlefarm/init.lua (+1/-1)
data/tribes/buildings/productionsites/barbarians/farm/init.lua (+6/-6)
data/tribes/buildings/productionsites/barbarians/fishers_hut/init.lua (+1/-1)
data/tribes/buildings/productionsites/barbarians/gamekeepers_hut/init.lua (+1/-1)
data/tribes/buildings/productionsites/barbarians/hunters_hut/init.lua (+1/-1)
data/tribes/buildings/productionsites/barbarians/inn/init.lua (+2/-2)
data/tribes/buildings/productionsites/barbarians/lime_kiln/init.lua (+2/-2)
data/tribes/buildings/productionsites/barbarians/lumberjacks_hut/init.lua (+1/-1)
data/tribes/buildings/productionsites/barbarians/metal_workshop/init.lua (+10/-10)
data/tribes/buildings/productionsites/barbarians/quarry/init.lua (+1/-1)
data/tribes/buildings/productionsites/barbarians/rangers_hut/init.lua (+1/-1)
data/tribes/buildings/productionsites/barbarians/reed_yard/init.lua (+6/-6)
data/tribes/buildings/productionsites/barbarians/scouts_hut/init.lua (+1/-1)
data/tribes/buildings/productionsites/barbarians/shipyard/init.lua (+1/-1)
data/tribes/buildings/productionsites/barbarians/smelting_works/init.lua (+4/-4)
data/tribes/buildings/productionsites/barbarians/tavern/init.lua (+1/-1)
data/tribes/buildings/productionsites/barbarians/warmill/init.lua (+12/-12)
data/tribes/buildings/productionsites/barbarians/weaving_mill/init.lua (+2/-2)
data/tribes/buildings/productionsites/barbarians/wood_hardener/init.lua (+1/-1)
data/tribes/buildings/productionsites/empire/brewery/init.lua (+1/-1)
data/tribes/buildings/productionsites/empire/donkeyfarm/init.lua (+1/-1)
data/tribes/buildings/productionsites/empire/farm/init.lua (+6/-6)
data/tribes/buildings/productionsites/empire/fishers_house/init.lua (+1/-1)
data/tribes/buildings/productionsites/empire/foresters_house/init.lua (+1/-1)
data/tribes/buildings/productionsites/empire/hunters_house/init.lua (+1/-1)
data/tribes/buildings/productionsites/empire/inn/init.lua (+2/-2)
data/tribes/buildings/productionsites/empire/lumberjacks_house/init.lua (+1/-1)
data/tribes/buildings/productionsites/empire/mill/init.lua (+1/-1)
data/tribes/buildings/productionsites/empire/piggery/init.lua (+1/-1)
data/tribes/buildings/productionsites/empire/quarry/init.lua (+2/-2)
data/tribes/buildings/productionsites/empire/sawmill/init.lua (+1/-1)
data/tribes/buildings/productionsites/empire/scouts_house/init.lua (+1/-1)
data/tribes/buildings/productionsites/empire/sheepfarm/init.lua (+1/-1)
data/tribes/buildings/productionsites/empire/shipyard/init.lua (+1/-1)
data/tribes/buildings/productionsites/empire/smelting_works/init.lua (+4/-4)
data/tribes/buildings/productionsites/empire/stonemasons_house/init.lua (+1/-1)
data/tribes/buildings/productionsites/empire/tavern/init.lua (+1/-1)
data/tribes/buildings/productionsites/empire/toolsmithy/init.lua (+12/-12)
data/tribes/buildings/productionsites/empire/vineyard/init.lua (+6/-6)
data/tribes/buildings/productionsites/empire/weaponsmithy/init.lua (+10/-10)
data/tribes/buildings/productionsites/empire/weaving_mill/init.lua (+1/-1)
data/tribes/buildings/productionsites/empire/winery/init.lua (+1/-1)
data/tribes/buildings/productionsites/frisians/aqua_farm/init.lua (+2/-2)
data/tribes/buildings/productionsites/frisians/armor_smithy_large/init.lua (+4/-4)
data/tribes/buildings/productionsites/frisians/armor_smithy_small/init.lua (+4/-4)
data/tribes/buildings/productionsites/frisians/beekeepers_house/init.lua (+1/-1)
data/tribes/buildings/productionsites/frisians/berry_farm/init.lua (+1/-1)
data/tribes/buildings/productionsites/frisians/clay_pit/init.lua (+1/-1)
data/tribes/buildings/productionsites/frisians/collectors_house/init.lua (+1/-1)
data/tribes/buildings/productionsites/frisians/farm/init.lua (+2/-2)
data/tribes/buildings/productionsites/frisians/fishers_house/init.lua (+1/-1)
data/tribes/buildings/productionsites/frisians/foresters_house/init.lua (+1/-1)
data/tribes/buildings/productionsites/frisians/hunters_house/init.lua (+5/-5)
data/tribes/buildings/productionsites/frisians/quarry/init.lua (+1/-1)
data/tribes/buildings/productionsites/frisians/reed_farm/init.lua (+2/-2)
data/tribes/buildings/productionsites/frisians/scouts_house/init.lua (+1/-1)
data/tribes/buildings/productionsites/frisians/shipyard/init.lua (+1/-1)
data/tribes/buildings/productionsites/frisians/woodcutters_house/init.lua (+1/-1)
data/tribes/buildings/trainingsites/atlanteans/dungeon/init.lua (+9/-9)
data/tribes/buildings/trainingsites/atlanteans/labyrinth/init.lua (+11/-11)
data/tribes/buildings/trainingsites/barbarians/battlearena/init.lua (+5/-5)
data/tribes/buildings/trainingsites/barbarians/trainingcamp/init.lua (+17/-17)
data/tribes/buildings/trainingsites/empire/arena/init.lua (+3/-3)
data/tribes/buildings/trainingsites/empire/colosseum/init.lua (+5/-5)
data/tribes/buildings/trainingsites/empire/trainingcamp/init.lua (+17/-17)
data/tribes/buildings/trainingsites/frisians/training_arena/init.lua (+11/-11)
data/tribes/buildings/trainingsites/frisians/training_camp/init.lua (+11/-11)
data/tribes/immovables/shipconstruction_atlanteans/init.lua (+1/-1)
data/tribes/immovables/shipconstruction_barbarians/init.lua (+1/-1)
data/tribes/immovables/shipconstruction_empire/init.lua (+1/-1)
data/tribes/immovables/shipconstruction_frisians/init.lua (+1/-1)
data/tribes/scripting/starting_conditions/frisians/trading_outpost.lua (+3/-3)
data/tribes/workers/atlanteans/blackroot_farmer/init.lua (+11/-11)
data/tribes/workers/atlanteans/farmer/init.lua (+12/-12)
data/tribes/workers/atlanteans/fishbreeder/init.lua (+4/-4)
data/tribes/workers/atlanteans/fisher/init.lua (+7/-7)
data/tribes/workers/atlanteans/forester/init.lua (+6/-6)
data/tribes/workers/atlanteans/geologist/init.lua (+6/-6)
data/tribes/workers/atlanteans/hunter/init.lua (+5/-5)
data/tribes/workers/atlanteans/scout/init.lua (+1/-1)
data/tribes/workers/atlanteans/shipwright/init.lua (+5/-5)
data/tribes/workers/atlanteans/stonecutter/init.lua (+6/-6)
data/tribes/workers/atlanteans/woodcutter/init.lua (+8/-8)
data/tribes/workers/barbarians/farmer/init.lua (+12/-12)
data/tribes/workers/barbarians/fisher/init.lua (+7/-7)
data/tribes/workers/barbarians/gamekeeper/init.lua (+5/-6)
data/tribes/workers/barbarians/gardener/init.lua (+13/-13)
data/tribes/workers/barbarians/geologist/init.lua (+6/-6)
data/tribes/workers/barbarians/hunter/init.lua (+5/-5)
data/tribes/workers/barbarians/lumberjack/init.lua (+10/-10)
data/tribes/workers/barbarians/ranger/init.lua (+6/-6)
data/tribes/workers/barbarians/scout/init.lua (+1/-1)
data/tribes/workers/barbarians/shipwright/init.lua (+5/-5)
data/tribes/workers/barbarians/stonemason/init.lua (+6/-6)
data/tribes/workers/empire/farmer/init.lua (+12/-12)
data/tribes/workers/empire/fisher/init.lua (+7/-7)
data/tribes/workers/empire/forester/init.lua (+6/-6)
data/tribes/workers/empire/geologist/init.lua (+6/-6)
data/tribes/workers/empire/hunter/init.lua (+5/-5)
data/tribes/workers/empire/lumberjack/init.lua (+10/-10)
data/tribes/workers/empire/scout/init.lua (+1/-1)
data/tribes/workers/empire/shipwright/init.lua (+5/-5)
data/tribes/workers/empire/stonemason/init.lua (+12/-12)
data/tribes/workers/empire/vinefarmer/init.lua (+13/-13)
data/tribes/workers/frisians/beekeeper/init.lua (+4/-4)
data/tribes/workers/frisians/berry_farmer/init.lua (+6/-6)
data/tribes/workers/frisians/claydigger/init.lua (+4/-4)
data/tribes/workers/frisians/farmer/init.lua (+11/-11)
data/tribes/workers/frisians/fisher/init.lua (+14/-14)
data/tribes/workers/frisians/forester/init.lua (+6/-6)
data/tribes/workers/frisians/fruit_collector/init.lua (+6/-6)
data/tribes/workers/frisians/geologist/init.lua (+7/-7)
data/tribes/workers/frisians/hunter/init.lua (+5/-5)
data/tribes/workers/frisians/reed_farmer/init.lua (+11/-11)
data/tribes/workers/frisians/scout/init.lua (+1/-1)
data/tribes/workers/frisians/shipwright/init.lua (+4/-4)
data/tribes/workers/frisians/stonemason/init.lua (+5/-5)
data/tribes/workers/frisians/woodcutter/init.lua (+7/-7)
doc/sphinx/source/productionsite_program.rst (+20/-11)
src/graphic/animation.cc (+1/-1)
src/logic/map_objects/immovable.cc (+24/-23)
src/logic/map_objects/immovable.h (+2/-2)
src/logic/map_objects/immovable_program.h (+2/-2)
src/logic/map_objects/tribes/production_program.cc (+11/-11)
src/logic/map_objects/tribes/production_program.h (+2/-2)
src/logic/map_objects/tribes/productionsite.h (+1/-1)
src/logic/map_objects/tribes/worker.cc (+37/-47)
src/logic/map_objects/tribes/worker.h (+6/-7)
src/logic/map_objects/tribes/worker_program.cc (+225/-239)
src/logic/map_objects/tribes/worker_program.h (+6/-7)
src/logic/map_objects/world/critter.cc (+1/-1)
src/sound/sound_handler.h (+1/-1)
Changed in widelands: | |
assignee: | nobody → GunChleoc (gunchleoc) |
status: | Confirmed → In Progress |
Changed in widelands: | |
milestone: | none → build20-rc1 |
status: | In Progress → Fix Committed |
assignee: | GunChleoc (gunchleoc) → nobody |
Fixed in build20-rc1