public Bacteria(BacteriumType type, Gas g, float amt, float optimal, float growthRate, float productionRate) { Type = type; GasType = g; Amount = amt; OptimalAmount = optimal; GrowthRate = growthRate; ProductionRate = productionRate; }
public Bacterium[] Division(int age, BacteriumType type) { Bacterium[] bacteria = new Bacterium[type.ChieldCount + type.ChieldCount]; for (int i = 0; i < bacteria.Length; i++) { bacteria[i] = new Bacterium(type); } return(bacteria); }
public BacteriumType GetBacterium(string kind, int lifeCycle, int chieldCount, int divisionsCount, int tMin, int tMax) { BacteriumType type = cache.Find(item => item.Kind == kind); if (type == null) { type = new BacteriumType(kind, lifeCycle, chieldCount, divisionsCount, tMin, tMax); cache.Add(type); } return(type); }
public Bacterium[] Division(int age, BacteriumType type) { if ((type.LifeCycle * 2) % age == 0) { if (age / 2 <= type.DivisionsCount) { Bacterium[] bacteria = new Bacterium[type.ChieldCount]; for (int i = 0; i < bacteria.Length; i++) { bacteria[i] = new Bacterium(type); } return(bacteria); } } return(null); }
public ItemBacteriaVial(ItemID id, String name, Texture tex, float bacteriaAmount = DEFAULT_VIAL_AMT) : base(id, name, tex, Item.ItemType.PROCESSED) { Amount = bacteriaAmount; BType = bacteriumVials[Id]; }
public Bacterium[] Division(int age, BacteriumType type) { return(null); }
public Bacteria(BacteriumType type, float amt = 0, float optimal = DEFAULT_OPTIMAL_AMT, float growthRate = DEFAULT_GROWTH_RATE, float productionRate = DEFAULT_PRODUCTION_RATE) : this(type, defaultProduction[type], amt, optimal, growthRate, productionRate) { }
public bool TryGetBacteria(BacteriumType type, out Bacteria bacteria) => bacteriaTypes.TryGetValue(type, out bacteria);
public Bacteria GetBacteria(BacteriumType type) => bacteriaTypes[type];
public Bacterium(BacteriumType type) { Type = type; age = 0; }