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(); }
private void removeTreeInfection() { if (TreeInfection != null) { Destroy(TreeInfection.gameObject); TreeInfection = null; } }
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); }
public void addTreeInfectingFungi() { TreeInfection = CreateFungi(_treeInfectPrefab); }
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; } }
public static string GetFungi(Fungi fungi) { return(m_Fungi[(int)fungi]); }
public void StartDrag(Hexagon startHexagon) { this.startHexagon = startHexagon; startHexChildScript = startHexagon.TileInfection; }