Commit Graph

24 Commits (master)

Author SHA1 Message Date
Mark fc6c48078f Fix unit test: Liquid container
Adjusted some return values - it turned out that the test was actually wrong in these cases
2017-12-27 20:32:45 +01:00
Mark d51a8cfa6d Liquds: Liquids can be passed either as a string or as a definition 2016-06-05 12:05:48 +02:00
Mark 923ee485ec Liquid container: PutLiquid(*, nil, *) inserts maximum amount of liquid
Added unit test.
2016-06-05 12:05:42 +02:00
Mark 1c1ea38efa Renamed the liquids IDs
Omitted the prefix "Liquid_".
2016-03-25 19:11:55 +01:00
Mark 49fdd59362 Refactoring: Stackable: Moved callback CollectFromStack()
The callback happens in every call to MergeWithStacksIn() now, instead of RejectEntrance(). Otherwise the following use case does not work: Liquid enters crew/building and fills the contained barrels. Added a unit test for that use case. Stackable unit tests still pass.
2016-03-17 18:43:08 +01:00
Mark a2700890ce Refactoring: Unit test for liquid containers uses doTest()
This is more readable and failures can be identified more easily.
2016-03-17 18:13:40 +01:00
Mark 96e59a0626 Failed attempt at unit test nr. 6 2016-03-03 22:10:10 +01:00
Mark 3c05d53b3a Liquid objects: Added unit test 5 2016-03-03 17:20:58 +01:00
Mark 1786f5b3d9 Liquid objects: Fix unit test, Stackable
Addedv debugging logs, will remove them once all unit tests work. The stackable library function "TryPutInto" was changed slightly.
2016-03-03 17:10:43 +01:00
Mark a7ed516c39 Refactoring: Liquid container
The liquid container library was severely reduced by the changes that the liquid objects bring. The remaining unit tests nearly work.
2016-03-01 22:29:35 +01:00
Mark 351e61832c Liquid Container: Fixed liquid objects remaining in existence after test. 2016-02-26 22:38:38 +01:00
Mark 55401f88e3 Liquid object: Fixed unit test 12
Added test for filling an empty barrel partially
2016-02-26 15:42:54 +01:00
Mark 79df36eb6b Liquid object: Refactored object entering system.
Unit test 3 still fails, because the functions are not runtime overloadable. Test 12 fails, because liquid transfer does not work correctly yet. This fill be fixed in the next checkin.

Added debug logging, this has to be removed again later.
2016-02-26 15:19:41 +01:00
Mark 862e69655e Liquid object: Test for liquid leaving the container 2016-02-20 21:10:41 +01:00
Mark 7cc88bd909 Liquid Object: Simplified transfer into liquid container.
Unfortunately, now the object is not actually transferred, but removed, and a new one is created or an existing one is filled in the liquid container. The logic could use a rework actually, because everything was more clear when the container stored things in variables.
2016-02-20 21:00:48 +01:00
Mark 9e46d752a9 Liquid Object: Unit test for entering liquid containers
The tests handles the entrance of liquid objects into the container. Will look to simplify the script in the next commit.
2016-02-20 20:14:19 +01:00
Mark 8c578931bb Liquid Object: Replaced liquid container logic
The liquid container now stores liquid objects, instead of volume and liquid type. Liquid objects can have be of a specific type, such as Liquid_Water, Liquid_Oil, etc..., but they can also just stay Library_Liquid for other liquids.
The liquid container logic has become more complex now, but still works as before. Transferring liquids to other objects may still need some improvements:
- at the moment, transferring liquids between liquid containers is possible
- maybe liquids objects, such as oil, can enter a liquid container while another liquid is in that container already - will need a unit test for that
- transferring liquid from a liquid container to a structure or crew member should be possible (but is not yet), if the target is not a liquid container but contains liquid containers
2016-02-19 06:53:44 +01:00
Mark 6f7152eba6 Fixed bug in barrel stacking and added a unit test for this use case 2016-02-16 21:07:31 +01:00
Mark 1f54927aee Unit test for line connections 2016-02-16 21:04:11 +01:00
Mark be8fd0833c Oil-burning steam engine
The steam engine can burn oil as fuel now. Added test to power system unit test. Still needs support for actually getting oil into the engine.
Fixed a bug in LiquidContainer that would return no liquid if the entire contents are removed. Added unit test for said bug.
Fixed overspilling of connected liquid containers. Pump no longer counts as a liquid container/tank, so that it still spills liquid if no drain is connected.
2016-02-16 21:04:06 +01:00
Mark fbdd5eeb09 Refactoring: Pimp, Pipe, SteamEngine
Now it is possible to connect lines from a pump to the steam engine. This is achieved by the steam engine being a liquid tank. It did not seem good to allow connection from pumps to all liquid containers (i.e. barrels). A liquid tank is also a liquid container, they share the same interface, but it is also a structure.

It is not yet possible to fill the steam engine with any liquid though, because it is not defined what kind of liquid it accepts. This will be oil in the future. Furthermore, the behaviour when the pump adds incompatible liquid is not defined yet.
2016-02-16 21:02:28 +01:00
Mark 6f557520e8 Refactoring: Renamed Set/GetLiquidName to Set/GetLiquidType 2016-02-16 21:02:09 +01:00
Mark 9d17cff91e Refactoring: Removed old barrel functions
Replaced old barrel functions with the liquid container library calls
2016-02-16 21:01:59 +01:00
Mark 2f5cc035b6 Library: Liquid Container
Added unit test.
2016-02-16 21:01:55 +01:00