private static void InsertBender(string[] cmdArgs, List <Nation> nations) { var type = cmdArgs[1]; var name = cmdArgs[2]; var power = int.Parse(cmdArgs[3]); var secondaryParam = double.Parse(cmdArgs[4]); switch (type) { case "Air": Bender airBender = new AirBender(name, power, secondaryParam); var airNation = nations.FirstOrDefault(n => n.Name == "Air Nation"); airNation.Benders.Add(airBender); break; case "Earth": Bender earthBender = new EarthBender(name, power, secondaryParam); var earthNation = nations.FirstOrDefault(n => n.Name == "Earth Nation"); earthNation.Benders.Add(earthBender); break; case "Fire": Bender fireBender = new FireBender(name, power, secondaryParam); var fireNation = nations.FirstOrDefault(n => n.Name == "Fire Nation"); fireNation.Benders.Add(fireBender); break; case "Water": Bender waterBender = new WaterBender(name, power, secondaryParam); var waterNation = nations.FirstOrDefault(n => n.Name == "Water Nation"); waterNation.Benders.Add(waterBender); break; } }
public void AssignBender(List <string> benderArgs) { switch (benderArgs[1]) { case "Fire": var fireBender = new FireBender(benderArgs[2], int.Parse(benderArgs[3]), double.Parse(benderArgs[4])); nations.FireNation.Add(fireBender); break; case "Air": var airBender = new AirBender(benderArgs[2], int.Parse(benderArgs[3]), double.Parse(benderArgs[4])); nations.AirNation.Add(airBender); break; case "Water": var waterBender = new WaterBender(benderArgs[2], int.Parse(benderArgs[3]), double.Parse(benderArgs[4])); nations.WaterNation.Add(waterBender); break; case "Earth": var earthBender = new EarthBender(benderArgs[2], int.Parse(benderArgs[3]), double.Parse(benderArgs[4])); nations.EarthNation.Add(earthBender); break; } }
public Bender CreateBender(List <string> benderArgs) { Bender newBender = null; var type = benderArgs[0]; var name = benderArgs[1]; var power = int.Parse(benderArgs[2]); var secondaryParameter = double.Parse(benderArgs[3]); switch (type) { case "Air": newBender = new AirBender(name, power, secondaryParameter); break; case "Water": newBender = new WaterBender(name, power, secondaryParameter); break; case "Fire": newBender = new FireBender(name, power, secondaryParameter); break; case "Earth": newBender = new EarthBender(name, power, secondaryParameter); break; default: throw new NotSupportedException(); } return(newBender); }
public static Bender MakeBender(string type, string name, int power, double secondaryParameter) { Bender bender = null; switch (type) { case "Air": bender = new AirBender(name, power, secondaryParameter); break; case "Water": bender = new WaterBender(name, power, secondaryParameter); break; case "Fire": bender = new FireBender(name, power, secondaryParameter); break; case "Earth": bender = new EarthBender(name, power, secondaryParameter); break; } return(bender); }
public void AssignBender(List <string> benderArgs) { var nationBender = benderArgs[1]; var nameOfBender = benderArgs[2]; var powerOfBender = int.Parse(benderArgs[3]); var secondaryParameter = double.Parse(benderArgs[4]); switch (nationBender) { case "Air": Bender airBender = new AirBender(nameOfBender, powerOfBender, secondaryParameter); bendersOfNation[nationBender].Add(airBender); break; case "Water": Bender waterBender = new WaterBender(nameOfBender, powerOfBender, secondaryParameter); bendersOfNation[nationBender].Add(waterBender); break; case "Fire": Bender fireBender = new FireBender(nameOfBender, powerOfBender, secondaryParameter); bendersOfNation[nationBender].Add(fireBender); break; case "Earth": Bender earthBender = new EarthBender(nameOfBender, powerOfBender, secondaryParameter); bendersOfNation[nationBender].Add(earthBender); break; } }
public void AssignBender(List <string> benderArgs) { var type = benderArgs[0]; var name = benderArgs[1]; var power = int.Parse(benderArgs[2]); var secondaryParameter = double.Parse(benderArgs[3]); switch (type) { case "Air": Bender bender = new AirBender(name, power, secondaryParameter); this.nations[type].AddBender(bender); break; case "Water": bender = new WaterBender(name, power, secondaryParameter); this.nations[type].AddBender(bender); break; case "Fire": bender = new FireBender(name, power, secondaryParameter); this.nations[type].AddBender(bender); break; case "Earth": bender = new EarthBender(name, power, secondaryParameter); this.nations[type].AddBender(bender); break; } }//Done
public static Bender CreateBender(List <string> benderArgs) { Bender bender = null; string name = benderArgs[2]; int power = int.Parse(benderArgs[3]); double secondaryParam = double.Parse(benderArgs[4]); switch (benderArgs[1]) { case "Air": bender = new AirBender(name, power, secondaryParam); break; case "Water": bender = new WaterBender(name, power, secondaryParam); break; case "Fire": bender = new FireBender(name, power, secondaryParam); break; case "Earth": bender = new EarthBender(name, power, secondaryParam); break; } return(bender); }
public void AssignBender(List <string> benderArgs) { var type = benderArgs[0]; var name = benderArgs[1]; var power = int.Parse(benderArgs[2]); var secondParam = double.Parse(benderArgs[3]); switch (type) { case "Air": var airBender = new AirBender(name, power, secondParam); this.AddBenderToNation(type, airBender); break; case "Earth": var earthBender = new EarthBender(name, power, secondParam); this.AddBenderToNation(type, earthBender); break; case "Fire": var fireBender = new FireBender(name, power, secondParam); this.AddBenderToNation(type, fireBender); break; case "Water": var waterBender = new WaterBender(name, power, secondParam); this.AddBenderToNation(type, waterBender); break; } }
public void AssignBender(List <string> benderArgs) { var benderType = benderArgs[1]; var benderName = benderArgs[2]; var power = int.Parse(benderArgs[3]); var integrity = double.Parse(benderArgs[4]); Bender currBender = null; switch (benderType) { case "Air": currBender = new AirBender(benderName, power, integrity); airNation.Add(currBender); break; case "Fire": currBender = new FireBender(benderName, power, integrity); fireNation.Add(currBender); break; case "Water": currBender = new WaterBender(benderName, power, integrity); waterNation.Add(currBender); break; case "Earth": currBender = new EarthBender(benderName, power, integrity); earthNation.Add(currBender); break; } }
public void AssignBender(List <string> benderArgs) { var typeOfBender = benderArgs[1]; var nameOfBender = benderArgs[2]; var powerOfBender = int.Parse(benderArgs[3]); var secondPower = double.Parse(benderArgs[4]); switch (typeOfBender) { case "Air": Bender airBender = new AirBender(nameOfBender, powerOfBender, secondPower); this.nations[typeOfBender].AddBender(airBender); break; case "Water": Bender waterBender = new WaterBender(nameOfBender, powerOfBender, secondPower); this.nations[typeOfBender].AddBender(waterBender); break; case "Fire": Bender fireBender = new FireBender(nameOfBender, powerOfBender, secondPower); this.nations[typeOfBender].AddBender(fireBender); break; case "Earth": Bender earthBender = new EarthBender(nameOfBender, powerOfBender, secondPower); this.nations[typeOfBender].AddBender(earthBender); break; } }
public static Bender CreateBender(List <string> benderArgs) { var type = benderArgs[1]; var name = benderArgs[2]; int power = int.Parse(benderArgs[3]); double secondaryPower = double.Parse(benderArgs[4]); Bender bender; switch (type) { case "Air": bender = new AirBender(name, power, secondaryPower); return(bender); case "Water": bender = new WaterBender(name, power, secondaryPower); return(bender); case "Fire": bender = new FireBender(name, power, secondaryPower); return(bender); default: bender = new EarthBender(name, power, secondaryPower); return(bender); } }
public void AssignBender(List <string> benderArgs) { string type = benderArgs[1]; switch (type) { case "Air": AirBender airBender = new AirBender(benderArgs[2], int.Parse(benderArgs[3]), double.Parse(benderArgs[4])); this.nations["Air"].Benders.Add(airBender); break; case "Earth": EarthBender earthBender = new EarthBender(benderArgs[2], int.Parse(benderArgs[3]), double.Parse(benderArgs[4])); this.nations["Earth"].Benders.Add(earthBender); break; case "Fire": FireBender fireBender = new FireBender(benderArgs[2], int.Parse(benderArgs[3]), double.Parse(benderArgs[4])); this.nations["Fire"].Benders.Add(fireBender); break; case "Water": WaterBender waterBender = new WaterBender(benderArgs[2], int.Parse(benderArgs[3]), double.Parse(benderArgs[4])); this.nations["Water"].Benders.Add(waterBender); break; } }
public void AssignBender(List <string> benderArgs) { string type = benderArgs[0]; string name = benderArgs[1]; int power = int.Parse(benderArgs[2]); decimal secondParameter = decimal.Parse(benderArgs[3]); Bender bender = null; switch (type) { case "Air": bender = new AirBender(name, power, secondParameter); break; case "Water": bender = new WaterBender(name, power, secondParameter); break; case "Fire": bender = new FireBender(name, power, secondParameter); break; case "Earth": bender = new EarthBender(name, power, secondParameter); break; } benders.Add(new KeyValuePair <string, Bender>(type, bender)); }
public void AssignBender(List <string> benderArgs) { var benderType = benderArgs[1]; switch (benderType) { case "Air": var air = new AirBender(benderArgs[2], int.Parse(benderArgs[3]), double.Parse(benderArgs[4])); airNation.AddAirBenders(air); break; case "Water": var water = new WaterBender(benderArgs[2], int.Parse(benderArgs[3]), double.Parse(benderArgs[4])); waterNation.AddWaterBender(water); break; case "Fire": var fire = new FireBender(benderArgs[2], int.Parse(benderArgs[3]), double.Parse(benderArgs[4])); fireNation.AddFireBender(fire); break; case "Earth": var earth = new EarthBender(benderArgs[2], int.Parse(benderArgs[3]), double.Parse(benderArgs[4])); earthNation.AddEarthBender(earth); break; } }
public void AssignBender(List <string> benderArgs) { var type = benderArgs[0]; var name = benderArgs[1]; var power = int.Parse(benderArgs[2]); var secondaryParameter = double.Parse(benderArgs[3]); Bender bender = null; switch (type) { case "Air": bender = new AirBender(name, power, secondaryParameter); break; case "Earth": bender = new EarthBender(name, power, secondaryParameter); break; case "Fire": bender = new FireBender(name, power, secondaryParameter); break; case "Water": bender = new WaterBender(name, power, secondaryParameter); break; default: throw new ArgumentException(); } nations[type].benders.Add(bender); }
private void CreateBender(string type, string name, long power, decimal secondaryParameter) { switch (type) { case "Fire": FireBender fireBender = new FireBender(name, power, secondaryParameter); this.fireNation.FireBenders.Add(fireBender); break; case "Water": WaterBender waterBender = new WaterBender(name, power, secondaryParameter); this.waterNation.WaterBenders.Add(waterBender); break; case "Air": AirBender airBender = new AirBender(name, power, secondaryParameter); this.airNation.AirBenders.Add(airBender); break; case "Earth": EarthBender earthBender = new EarthBender(name, power, secondaryParameter); this.earthNation.EarthBenders.Add(earthBender); break; } }
public void AssignBender(List <string> benderArgs) { string type = benderArgs[0]; string name = benderArgs[1]; int power = int.Parse(benderArgs[2]); double secondaryParameter = double.Parse(benderArgs[3]); if (type == "Air") { AirBender airBender = new AirBender(name, power, secondaryParameter); benders.Add(airBender); } else if (type == "Water") { WaterBender waterBender = new WaterBender(name, power, secondaryParameter); benders.Add(waterBender); } else if (type == "Fire") { FireBender fireBender = new FireBender(name, power, secondaryParameter); benders.Add(fireBender); } else if (type == "Earth") { EarthBender earthBender = new EarthBender(name, power, secondaryParameter); benders.Add(earthBender); } }
public void AssignBender(List <string> benderArgs) { string type = benderArgs[0]; string name = benderArgs[1]; int power = int.Parse(benderArgs[2]); double secondaryParameter = double.Parse(benderArgs[3]); switch (type) { case "Air": Bender airBender = new AirBender(name, power, secondaryParameter); this.nations[type].AddBender(airBender); break; case "Water": Bender waterBender = new WaterBender(name, power, secondaryParameter); this.nations[type].AddBender(waterBender); break; case "Fire": Bender fireBender = new FireBender(name, power, secondaryParameter); this.nations[type].AddBender(fireBender); break; case "Earth": Bender earthBender = new EarthBender(name, power, secondaryParameter); this.nations[type].AddBender(earthBender); break; } }
public void AssignBender(List <string> benderArgs) { var type = benderArgs[0]; var name = benderArgs[1]; var power = int.Parse(benderArgs[2]); var secParam = double.Parse(benderArgs[3]); Bender bender = null; switch (type) { case "Air": bender = new AirBender(name, power, secParam); break; case "Water": bender = new WaterBender(name, power, secParam); break; case "Fire": bender = new FireBender(name, power, secParam); break; case "Earth": bender = new EarthBender(name, power, secParam); break; default: break; } nations[type].type = type; nations[type].Benders.Add(bender); }
// Update is called once per frame void Update() { if (combatState) { target = findEnemy(); if (target != null) { targetCoords = target.transform.position; anim.SetBool("IsWalking", true); if (findDistance(this.transform.position, targetCoords) < range) { anim.SetBool("IsWalking", false); agent.isStopped = true; timer -= Time.deltaTime; if (timer < 0) { if (target.GetComponent <AirBender>() != null) { AirBender instance = target.GetComponent <AirBender>(); instance.takeDamage(attack()); } else if (target.GetComponent <Assasin>() != null) { Assasin instance = target.GetComponent <Assasin>(); instance.takeDamage(attack()); } else if (target.GetComponent <EarthBender>() != null) { EarthBender instance = target.GetComponent <EarthBender>(); instance.takeDamage(attack()); } else if (target.GetComponent <FireBender>() != null) { FireBender instance = target.GetComponent <FireBender>(); instance.takeDamage(attack()); } else if (target.GetComponent <Warrior>() != null) { Warrior instance = target.GetComponent <Warrior>(); instance.takeDamage(attack()); } else if (target.GetComponent <WaterBender>() != null) { WaterBender instance = target.GetComponent <WaterBender>(); instance.takeDamage(attack()); } } } else { agent.isStopped = false; agent.SetDestination(targetCoords); } } } }
public void AssignBender(string type, string name, int power, double secondaryParameter) { if (type == "Air") { var airBender = new AirBender(name, power, secondaryParameter); airBenders.Add(airBender); } else if (type == "Water") { var waterBender = new WaterBender(name, power, secondaryParameter); waterBenders.Add(waterBender); } else if (type == "Fire") { var fireBender = new FireBender(name, power, secondaryParameter); fireBenders.Add(fireBender); } else if (type == "Earth") { var earthBender = new EarthBender(name, power, secondaryParameter); earthBenders.Add(earthBender); } }
public void AssignBender(List <string> benderArgs) { switch (benderArgs[0]) { case "Air": AirBender airBender = new AirBender(benderArgs[1], int.Parse(benderArgs[2]), double.Parse(benderArgs[3])); if (nations.Any(x => x.Name == "Air Nation")) { nations.Find(n => n.Name == "Air Nation").Benders.Add(airBender); } else { Nation nation = new Nation(); nation.Name = "Air Nation"; nation.Benders.Add(airBender); nations.Add(nation); } break; case "Water": WaterBender waterBender = new WaterBender(benderArgs[1], int.Parse(benderArgs[2]), double.Parse(benderArgs[3])); if (nations.Any(x => x.Name == "Water Nation")) { nations.Find(n => n.Name == "Water Nation").Benders.Add(waterBender); } else { Nation nation = new Nation(); nation.Name = "Water Nation"; nation.Benders.Add(waterBender); nations.Add(nation); } break; case "Fire": FireBender fireBender = new FireBender(benderArgs[1], int.Parse(benderArgs[2]), double.Parse(benderArgs[3])); if (nations.Any(x => x.Name == "Fire Nation")) { nations.Find(n => n.Name == "Fire Nation").Benders.Add(fireBender); } else { Nation nation = new Nation(); nation.Name = "Fire Nation"; nation.Benders.Add(fireBender); nations.Add(nation); } break; case "Earth": EarthBender earthBender = new EarthBender(benderArgs[1], int.Parse(benderArgs[2]), double.Parse(benderArgs[3])); if (nations.Any(x => x.Name == "Earth Nation")) { nations.Find(n => n.Name == "Earth Nation").Benders.Add(earthBender); } else { Nation nation = new Nation(); nation.Name = "Earth Nation"; nation.Benders.Add(earthBender); nations.Add(nation); } break; } }
public void turnOnCombat() { enemyArray = GameObject.FindGameObjectsWithTag("Enemy_Piece"); playerArray = GameObject.FindGameObjectsWithTag("Player_Piece"); for (int i = 0; i < enemyArray.Length; ++i) { if (enemyArray[i].GetComponent <Warrior_Enemy>() != null) { Warrior_Enemy instance = enemyArray[i].GetComponent <Warrior_Enemy>(); instance.isCombat(); } else if (enemyArray[i].GetComponent <Assasin_Enemy>() != null) { Assasin_Enemy instance = enemyArray[i].GetComponent <Assasin_Enemy>(); instance.isCombat(); } else if (enemyArray[i].GetComponent <FireBenderEnemy>() != null) { FireBenderEnemy instance = enemyArray[i].GetComponent <FireBenderEnemy>(); instance.isCombat(); } else if (enemyArray[i].GetComponent <WaterBender_Enemy>() != null) { WaterBender_Enemy instance = enemyArray[i].GetComponent <WaterBender_Enemy>(); instance.isCombat(); } else if (enemyArray[i].GetComponent <EarthBender_Enemy>() != null) { EarthBender_Enemy instance = enemyArray[i].GetComponent <EarthBender_Enemy>(); instance.isCombat(); } else if (enemyArray[i].GetComponent <Airbender_Enemy>() != null) { Airbender_Enemy instance = enemyArray[i].GetComponent <Airbender_Enemy>(); instance.isCombat(); } } for (int i = 0; i < playerArray.Length; ++i) { if (playerArray[i].GetComponent <AirBender>() != null) { AirBender instance = playerArray[i].GetComponent <AirBender>(); instance.isCombat(); } else if (playerArray[i].GetComponent <Assasin>() != null) { Assasin instance = playerArray[i].GetComponent <Assasin>(); instance.isCombat(); } else if (playerArray[i].GetComponent <EarthBender>() != null) { EarthBender instance = playerArray[i].GetComponent <EarthBender>(); instance.isCombat(); } else if (playerArray[i].GetComponent <FireBender>() != null) { FireBender instance = playerArray[i].GetComponent <FireBender>(); instance.isCombat(); } else if (playerArray[i].GetComponent <Warrior>() != null) { Warrior instance = playerArray[i].GetComponent <Warrior>(); instance.isCombat(); } else if (playerArray[i].GetComponent <WaterBender>() != null) { WaterBender instance = playerArray[i].GetComponent <WaterBender>(); instance.isCombat(); } } }
public void AddWaterBender(WaterBender waterBender) { this.WaterBenders.Add(waterBender); }