// Token: 0x060009F2 RID: 2546 RVA: 0x000D2240 File Offset: 0x000D0440 public static TerrainFeatureDescription getIndexFromTerrainFeature(TerrainFeature f) { if (f.GetType() == typeof(CosmeticPlant)) { return(new TerrainFeatureDescription(13, (int)((CosmeticPlant)f).grassType)); } if (f.GetType() == typeof(Grass)) { switch (((Grass)f).grassType) { case 1: return(new TerrainFeatureDescription(0, ((Grass)f).numberOfWeeds)); case 2: return(new TerrainFeatureDescription(1, ((Grass)f).numberOfWeeds)); case 3: return(new TerrainFeatureDescription(2, ((Grass)f).numberOfWeeds)); case 4: return(new TerrainFeatureDescription(3, ((Grass)f).numberOfWeeds)); } } else if (f.GetType() == typeof(Tree)) { switch (((Tree)f).treeType) { case 1: return(new TerrainFeatureDescription(4, ((Tree)f).growthStage)); case 2: return(new TerrainFeatureDescription(5, ((Tree)f).growthStage)); case 3: return(new TerrainFeatureDescription(6, ((Tree)f).growthStage)); case 4: return(new TerrainFeatureDescription(7, ((Tree)f).growthStage)); case 5: return(new TerrainFeatureDescription(8, ((Tree)f).growthStage)); case 7: return(new TerrainFeatureDescription(16, ((Tree)f).growthStage)); } } else if (f.GetType() == typeof(Quartz)) { int num = ((Quartz)f).bigness; if (num == 1) { return(new TerrainFeatureDescription(10, -1)); } if (num == 2) { return(new TerrainFeatureDescription(11, -1)); } } else { if (f.GetType() == typeof(HoeDirt)) { return(new TerrainFeatureDescription(12, -1)); } if (f.GetType() == typeof(Flooring)) { int num = ((Flooring)f).whichFloor; if (num == 0) { return(new TerrainFeatureDescription(14, -1)); } if (num == 1) { return(new TerrainFeatureDescription(15, -1)); } } else if (f is ResourceClump) { int num = (f as ResourceClump).parentSheetIndex; if (num == 600) { return(new TerrainFeatureDescription(20, -1)); } } } throw new MissingMethodException(); }
public static TerrainFeatureDescription getIndexFromTerrainFeature(TerrainFeature f) { if (f.GetType() == typeof(CosmeticPlant)) { return(new TerrainFeatureDescription((byte)13, (int)((Grass)f).grassType)); } if (f.GetType() == typeof(Grass)) { switch (((Grass)f).grassType) { case 1: return(new TerrainFeatureDescription((byte)0, ((Grass)f).numberOfWeeds)); case 2: return(new TerrainFeatureDescription((byte)1, ((Grass)f).numberOfWeeds)); case 3: return(new TerrainFeatureDescription((byte)2, ((Grass)f).numberOfWeeds)); case 4: return(new TerrainFeatureDescription((byte)3, ((Grass)f).numberOfWeeds)); } } else if (f.GetType() == typeof(Tree)) { switch (((Tree)f).treeType) { case 1: return(new TerrainFeatureDescription((byte)4, ((Tree)f).growthStage)); case 2: return(new TerrainFeatureDescription((byte)5, ((Tree)f).growthStage)); case 3: return(new TerrainFeatureDescription((byte)6, ((Tree)f).growthStage)); case 4: return(new TerrainFeatureDescription((byte)7, ((Tree)f).growthStage)); case 5: return(new TerrainFeatureDescription((byte)8, ((Tree)f).growthStage)); case 7: return(new TerrainFeatureDescription((byte)16, ((Tree)f).growthStage)); } } else if (f.GetType() == typeof(Quartz)) { switch (((Quartz)f).bigness) { case 1: return(new TerrainFeatureDescription((byte)10, -1)); case 2: return(new TerrainFeatureDescription((byte)11, -1)); } } else { if (f.GetType() == typeof(HoeDirt)) { return(new TerrainFeatureDescription((byte)12, -1)); } if (f.GetType() == typeof(Flooring)) { switch (((Flooring)f).whichFloor) { case 0: return(new TerrainFeatureDescription((byte)14, -1)); case 1: return(new TerrainFeatureDescription((byte)15, -1)); } } else if (f is ResourceClump && (f as ResourceClump).parentSheetIndex == 600) { return(new TerrainFeatureDescription((byte)20, -1)); } } throw new MissingMethodException(); }