private Colony(ColonyStats stats, ColonyParams par, ColonyProduction prod, double water) { _stats = stats; _production = prod; _freeWater = water; _params = par; }
public SimulationController() { model.PlanetCondition.PlanetConditionState state = new model.PlanetCondition.PlanetConditionState { freeWater = 0, organic = 0, co = 23830000000000000, n = 675000000000000, oxigen = 32500000000000, //TODO temperature temperature = -40 }; model.ColonyStats stats = new model.ColonyStats { num = 10, mass = 10 }; model.ColonyParams par = ParamsController.colonyParams; model.PlanetCondition contitions = new model.PlanetCondition(state, ParamsController.growthSpeed); model.Colony colony = new model.Colony(stats, par); _currentColony = colony; _conditions = contitions; defaultTemp = _conditions.getTemperature(); }
public Colony div() { ColonyStats newStats = _stats; newStats.num *= BioFunc.funcs.getDivRate(this); //newStats.num *= BioFunc.funcs.getSmallCellDeathRate(newStats); return(new Colony(newStats, _params, null, 0)); }
public Colony die(float avarageDeathRate) { ColonyStats newStats = _stats; newStats.mass *= avarageDeathRate; if (newStats.mass < 0.1) { newStats.mass = 0.001; } newStats.num *= avarageDeathRate; return(new Colony(newStats, _params, null, 0)); }
public Colony massGrow() { ColonyStats newStats = _stats; if (_stats.mass > linearMass) { newStats.mass += Math.Min(Math.Min(_freeWater, _stats.mass), max / 144000); } else { newStats.mass += Math.Min(_freeWater, _stats.mass); } return(new Colony(newStats, _params, null, 0)); }
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))); }
public Colony(ColonyStats stats, ColonyParams par) { _stats = stats; _params = par; }