private static void RegisterItemGenerators(ItemGeneratorDictionary itemGeneratorDictionary) { itemGeneratorDictionary.Register(ItemTypeEnum.HeadItem, HeadGenerator.GetGenerator()); itemGeneratorDictionary.Register(ItemTypeEnum.Pistol, PistolGenerator.GetGenerator()); itemGeneratorDictionary.Register(ItemTypeEnum.PistolAmmo, PistolAmmoGenerator.GetGenerator()); itemGeneratorDictionary.Register(ItemTypeEnum.Uzi, UziGenerator.GetGenerator()); itemGeneratorDictionary.Register(ItemTypeEnum.Shotgun, ShotgunGenerator.GetGenerator()); itemGeneratorDictionary.Register(ItemTypeEnum.ShotgunAmmo, ShotgunAmmoGenerator.GetGenerator()); itemGeneratorDictionary.Register(ItemTypeEnum.FirstAidPack, FirstAidGenerator.GetGenerator()); itemGeneratorDictionary.Register(ItemTypeEnum.CricketBat, CricketBatGenerator.GetGenerator()); itemGeneratorDictionary.Register(ItemTypeEnum.ZombieMaul, new ZombieMaulGenerator()); itemGeneratorDictionary.Register(ItemTypeEnum.Food, new FoodGenerator()); itemGeneratorDictionary.Register(ItemTypeEnum.WoodPlank, WoodPlankGenerator.GetGenerator()); }
public void LoadRandomStartParts() { AvailableParts.Clear( ); this.Head = HeadGenerator.GenerateRandomHead(PartClass.ClassOne); this.Core = CoreGenerator.GenerateRandomCore(PartClass.ClassOne); this.LeftArm = LeftArmGenerator.GenerateLeftArm(PartClass.ClassOne); this.RightArm = RightArmGenerator.GenerateRightArm(PartClass.ClassOne); this.Shoulders = ShoulderGenerator.GetRandomShoulder(PartClass.ClassOne); this.Legs = LegGenerator.GenerateRandomLegs(PartClass.ClassOne); AvailableParts.Add(this.head); AvailableParts.Add(this.core); AvailableParts.Add(this.leftArm); AvailableParts.Add(this.rightArm); AvailableParts.Add(this.shoulders); AvailableParts.Add(this.legs); }
private Part DropPart() { Part newPart; int type = rng.Next(1, 6); PartClass partClass = GetLeveledClass( ); switch (type) { case 1: newPart = HeadGenerator.GenerateRandomHead(partClass); break; case 2: newPart = CoreGenerator.GenerateRandomCore(partClass); break; case 3: newPart = LeftArmGenerator.GenerateLeftArm(partClass); break; case 4: newPart = RightArmGenerator.GenerateRightArm(partClass); break; case 5: newPart = LegGenerator.GenerateRandomLegs(partClass); break; default: newPart = new Head("ERROR", PartClass.ClassFive, EnemyScanAbility.None, 0.0f); break; } return(newPart); }