public void Load() { //Units XMLDataSerializer.LoadUnits("Assets/Data/Units.xml"); //Cards XMLDataSerializer.LoadCards("Assets/Data/Cards.xml"); //Todo Abilities //XMLDataSerializer.LoadAbilities("Assets/Data/Abilities.xml"); }
void CreatCard() { XMLDataSerializer.LoadCards("Assets/Data/Cards.xml"); //CardList cl = new CardList("main"); switch (cardTypeInt) { case 0: Action act = new Action(); act.type = NSGameplay.Cards.ECardType.Instant; act.cost = utilityCost; act.name = cardName; act.tooltip = new NSGameplay.Cards.Tooltip(); act.tooltip.description = cardDescription; act.tooltip.title = cardDescTitle; act.tooltip.image_Path = "path of an image"; act.damageOut = damageOut; act.damageIn = damageIn; act.healOut = healOut; act.healIn = healIn; act.armorUpIn = armorUpIn; act.armorUpOut = armorUpOut; act.armorDownIn = armorDownIn; act.armorDownOut = armorDownOut; Libraries.instance.Save_Card_Local(act); Libraries.instance.Save_Cards_To_File(); break; case 1: Minion min = new Minion(); min.type = NSGameplay.Cards.ECardType.Minion; min.cost = 2; min.name = cardName; min.tooltip = new NSGameplay.Cards.Tooltip(); min.tooltip.description = cardDescription; min.tooltip.title = cardDescTitle; min.tooltip.image_Path = "path of an image"; min.attack = minionAttack; min.baseDefence = minionBaseDefense; min.defence = minionBaseDefense; min.health = minionHealth; Libraries.instance.Save_Card_Local(min); Libraries.instance.Save_Cards_To_File(); break; case 2: Passive pas = new Passive(); break; } }
private void CreateNewUnit() { UnitInfo u = new UnitInfo(100, 5, 10, 1, "The first unit's name"); u.name = "Hunter"; UnitList ul = new UnitList("main"); ul.Add(u); XMLDataSerializer.SaveUnits(ul, "Assets/Data/Units.xml"); }
//Load the part reference data for a part configuration public static List <PartyReference> LoadParty() { if (!loaded) { XMLDataSerializer <PartyContainer> serializer = new XMLDataSerializer <PartyContainer>(XML_PATH_PREFIX + XML_PATH); PartyContainer container = serializer.Deserialize(); PartyReference = container.PartyReference; loaded = true; } return(PartyReference); }
private static void LoadCharacters() { if (!loaded) { XMLDataSerializer <BaseCharacterContainer> serializer = new XMLDataSerializer <BaseCharacterContainer>(XML_PATH_PREFIX + XML_PATH); BaseCharacterContainer container = serializer.Deserialize(); foreach (BaseCharacter character in container.BaseCharacters) { characters.Add(character.code, character); } loaded = true; } }
//Save Card Library to file public int Save_Cards_To_File() { int count = 0; CardList list = new CardList("main"); foreach (KeyValuePair <string, Card> c in Library_Card) { list.cardList.Add(c.Value); ++count; } XMLDataSerializer.SaveCards(list, "Assets/Data/Cards.xml"); Debug.Log("Saving " + count + " cards to file."); return(count); }
//Save the Unit Library to file. public int Save_Units_To_File() { int count = 0; UnitList list = new UnitList("main"); foreach (KeyValuePair <string, UnitInfo> u in Library_Unit) { list.unitList.Add(u.Value); ++count; } XMLDataSerializer.SaveUnits(list, _Library_Units_Path); Debug.Log("Saving " + count + " units to file."); return(count); }
public static List <IUser> ReturnDeserializedUsers() { XMLUsers deserializedUsers = XMLDataSerializer.DeserializeUsers(new XMLUsers()) as XMLUsers; if (deserializedUsers.Users == null) { return(new List <IUser> { }); } else { return(deserializedUsers.Users); } }
private void CreateNewCard() { Minion c = new Minion(); c.cost = 2; c.name = c.name.ParseName(); c.tooltip = new NSGameplay.Cards.Tooltip(); c.tooltip.description = "The description."; c.tooltip.title = "Title of tooltip"; c.tooltip.image_Path = "path of an image"; c.attack = 4; c.baseDefence = 2; c.defence = 2; c.health = 20; c.utility = 0; CardList cl = new CardList("main"); cl.cardList.Add(c); XMLDataSerializer.SaveCards(cl, "Assets/Data/Cards.xml"); }
public void SaveUsers() { XMLDataSerializer.SerializeUsers(new XMLUsers()); XMLFileManager.SaveFile(); Messenger.Default.Send(new NotificationMessage("DisableButtons")); }
private void LoadCards() { XMLDataSerializer.LoadCards("Assets/Data/Cards.xml"); }
private void LoadUnits() { Debug.Log("Loading units"); XMLDataSerializer.LoadUnits("Assets/Data/Units.xml"); }