Example #1
0
 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;
 }
Example #2
0
 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);
 }
Example #3
0
        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);
        }
Example #4
0
 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];
 }
Example #6
0
 public Bacterium[] Division(int age, BacteriumType type)
 {
     return(null);
 }
Example #7
0
 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)
 {
 }
Example #8
0
 public bool TryGetBacteria(BacteriumType type, out Bacteria bacteria)
 => bacteriaTypes.TryGetValue(type, out bacteria);
Example #9
0
 public Bacteria GetBacteria(BacteriumType type) => bacteriaTypes[type];
Example #10
0
 public Bacterium(BacteriumType type)
 {
     Type = type;
     age  = 0;
 }