Beispiel #1
0
        public static void SeedDefaultItems(AspergillosisContext context)
        {
            if (context.Fungis.Any())
            {
                return;
            }

            var allergyItems = new Fungi[]
            {
                new Fungi {
                    Name = "Candida albicans"
                },
                new Fungi {
                    Name = "Aspergillus fumigatus"
                },
                new Fungi {
                    Name = "Aspergillus niger"
                },
                new Fungi {
                    Name = "Aspergillus flavus"
                },
                new Fungi {
                    Name = "Aspergillus flavescens"
                },
                new Fungi {
                    Name = "Aspergillus nidulans"
                },
                new Fungi {
                    Name = "Aspergillus terreus"
                },
                new Fungi {
                    Name = "Altenaria"
                }
            };

            foreach (var item in allergyItems)
            {
                context.Fungis.Add(item);
            }
            context.SaveChanges();
        }
Beispiel #2
0
 private void removeTreeInfection()
 {
     if (TreeInfection != null)
     {
         Destroy(TreeInfection.gameObject);
         TreeInfection = null;
     }
 }
Beispiel #3
0
 public void updateFungi(Fungi fungi)
 {
     float speed = 1;
     //Should adjust it for multiple types, not extendable code! TODO
     if (Type == TreeType.SmallTree)
     {
         speed = 1 + 0.3f + (UnityEngine.Random.value / 4);
     } else if (Type == TreeType.BigTree)
     {
         speed = 1 + 0.5f + (UnityEngine.Random.value / 2);
     }
     fungi.advanceGrowth(speed);
 }
Beispiel #4
0
 public void addTreeInfectingFungi()
 {
     TreeInfection = CreateFungi(_treeInfectPrefab);
 }
Beispiel #5
0
    public void addTileInfectingFungi()
    {
        TileInfection = CreateFungi(_tileInfectPrefab);

        switch (HexState)
        {
            case HexagonState.CutTree:
            case HexagonState.Empty:
            case HexagonState.KillingInfectedTree:
            case HexagonState.KillingInfectedDeadWood:
            case HexagonState.InfectedSapling:
            case HexagonState.InfectedDeadWood:
            case HexagonState.KilledInfectedDeadWood:
            case HexagonState.InfectedTree:
            case HexagonState.InfectingSapling:
            case HexagonState.InfectingDeadWood:
            case HexagonState.InfectingTree:
                Debug.Assert(false, "unexpected state: " + HexState);
                break;
            case HexagonState.Sapling:
                _HexState = HexagonState.InfectingSapling;
                break;
            case HexagonState.Tree:
                _HexState = HexagonState.InfectingTree;
                break;
            case HexagonState.DeadWood:
                _HexState = HexagonState.InfectingDeadWood;
                break;
        }
    }
Beispiel #6
0
 public static string GetFungi(Fungi fungi)
 {
     return(m_Fungi[(int)fungi]);
 }
 public void StartDrag(Hexagon startHexagon)
 {
     this.startHexagon = startHexagon;
     startHexChildScript = startHexagon.TileInfection;
 }