Commit Graph

8 Commits

Author SHA1 Message Date
metalgearsloth
60ce5b5089 Add puddles / reagent spills (#743) 2020-04-21 20:23:12 +02:00
PrPleGoo
409d873403 Fix ratio issues on SlipSolution 2020-04-14 15:41:23 +02:00
PrPleGoo
4aa6c5cc69 Extra unit test 2020-04-09 20:43:45 +02:00
PrPleGoo
4e67f09488 Fixed comments
ReagentUnit now implements IComparable and IEquateable.
ReagentUnit now uses double internally.
Added multiplication without shifting for ints.
InvariantCulture for some string things.
Added units tests for Equals and CompareTo.
Added unit tests to Solution that deals with nasty fractionals.
2020-04-09 20:40:59 +02:00
PrPleGoo
4e0242d47c Replace decimal with ReagentUnit 2020-04-05 11:36:12 +02:00
moneyl
6a1d2124df Revert unnecessary changes made by previous PR to SolutionCompon… (#583)
#574 added an out arg to `SolutionComponent.TryRemoveSolution` containing the solution that was removed. I made this change since I thought there was no way to get the removed solution for further use. Didn't notice `SplitSolution` which provides nearly the same behavior. With this PR I want to remove that out arg from `TryRemoveSolution` to keep the SolutionComponent API simple and to avoid having multiple ways of doing things. Existing code uses `SplitSolution`, I just wasn't paying attention.

Feel free to deny merging this if I'm over thinking it. I think it'll help keep solution code from becoming a mess.
2020-02-06 16:13:32 +01:00
moneyl
972d601664 Add solution pouring / click-transfer (#574)
* Add click-based solution transfer

For example, clicking on a beaker with a soda can to transfer the soda to the beaker. Works on plain solution containers like beakers and also on open drink containers like soda cans as long as they have the `PourIn` and `PourOut` solution  capabilities. If no `SolutionComponent` is added to a drink entity, the `DrinkComponent` will give the entity one. This PR extends that behavior slightly by also giving these default `SolutionComponent`'s the proper capabilities for pouring in/out.

* Improve fix for poured drinks not immediately disappearing

Instead of making `DrinkComponent.Use` public this 
 splits out the code important to both users and made that function public, leaving `Use` private.

* Shorten solution transfer popup

* Make code review changes

- Move pouring code from SolutionComponent to new PourableComponent. Added PourableComponent to client ignore list and added to existing container prototypes.
- Added EmptyVolume property to shared SolutionComponent for convenience.
- Removed DrinkComponent fix from pouring AttackBy code. Instead DrinkComponent subscribes to the SolutionChanged action and updates its self when necessary.
- Fixed pouring being able to add more than a containers max volume and sometimes deleting reagents.
- Added message for when a container is full.

* More code review changes

- Remove IAttackBy ComponentReference attribute in PourableComponent
- Remove _transferAmount from shared SolutionComponent. Left over var from previous commit not being used anymore.
2020-01-29 02:07:02 +01:00
Acruid
2ea8bbf4eb Reagents & Solutions (#280)
* Added the ReagentPrototype class.

* Added the new Solution class.

* Added new shared SolutionComponent to the ECS system.

* Added some basic element and chemical reagent prototypes.

* Added a new Beaker item utilizing the SolutionComponent. This is a testing/debug entity, and should be removed or changed soon.

* Added filters for code coverage.

* Nightly work.

* Added the server SolutionComponent class.

* Added a bucket.
Verbs set up for solution interaction.

* Adds water tank entity to the game.

* Added a full water tank entity.
Solutions are properly serialized.
Solution can be poured between two containers.

* Solution class can now be enumerated.
SolutionComponent now calculates the color of the solution.

* Minor Cleanup.
2019-07-31 14:10:06 +02:00