private Colony(ColonyStats stats, ColonyParams par, ColonyProduction prod, double water) { _stats = stats; _production = prod; _freeWater = water; _params = par; }
public override StepRes execute(PlanetCondition conditions, Colony colony) { ColonyProduction prod = colony.getProduction(); PlanetCondition newCond = conditions .incOxygen(prod.oxygen) .incSurfaceN(prod.surfaceN); Colony newCol = colony.massGrow(); return(new StepRes { conditions = newCond, colony = newCol }); }
public Colony consume(double co, double water, double n, int time) { var production = new ColonyProduction { oxygen = co * 32.0 / 44.0, surfaceN = n * 17.0 / 28.0 }; float uptakeDeathRate = BioFunc.funcs.getUptakeDeathRate(this, co, water, n, time); ColonyStats newState = _stats; newState.mass *= uptakeDeathRate; if (newState.mass < 0.1) { newState.mass = 0.001; } newState.num *= uptakeDeathRate; return(new Colony(newState, _params, production, water - BioFunc.funcs.getMetabolicWater(this, time))); }