public static Banjo ParseSaveString(String saveString, Accordian player) { if (saveString.StartsWith("[Banjo]")) { String subString = saveString.Substring(7); String[] split = subString.Split(','); BanjoType type = (BanjoType)int.Parse(split[0]); double x = double.Parse(split[1]); double y = double.Parse(split[2]); int hp = int.Parse(split[3]); Banjo b = new Banjo(player, type); b.x = x; b.y = y; b.hp = hp; b.UpdateRect(); return b; } return null; }
/// <summary> /// This method will add a new banjo, based on the passed parameter. /// </summary> /// <param name="b"> /// The banjo to add to the game. /// </param> public void AddBanjo(Banjo b) { banjoes.Add(b); }
public void SetTargetEntity(Banjo e) { this.targetEntity = e; targetOldX = (int)e.x; }