public static void PlayerCreate(string i_name, string i_profession) { TalentPoints tem = new TalentPoints() { HP = 0, Agile = 0, Defense = 0, Power = 0, Precise = 0 }; Player player = new Player() { Name = i_name, Profession = i_profession, Equipments = new Array_Equipment(), Exp = 0, HP = 0, PP = 50, PP_Max = 50, Money = 0, RemainTalentPoints = 25, TalentPoints = tem }; Array_Item items = new Array_Item(); GameValue.Players.Add(player); GameDataWrite.GamePlayerSave(GameValue.Players, Environment.CurrentDirectory + "/Data/PlayerData/Players.txt"); string PlayerPath = Environment.CurrentDirectory + "/Data/PlayerData/" + player.Name + "/"; Directory.CreateDirectory(PlayerPath); PlayerDataWrite.PlayerItemSave(items, PlayerPath + "PlayerItem.txt"); PlayerDataWrite.PlayerEquipmentSave(player.Equipments, PlayerPath + "PlayerEquipment.txt"); }
public static void PlayerDelete(int index) { Directory.Delete(Environment.CurrentDirectory + "/Data/PlayerData/" + GameValue.Players[index].Name, true); GameValue.Players.RemoveAt(index); GameDataWrite.GamePlayerSave(GameValue.Players, Environment.CurrentDirectory + "/Data/PlayerData/Players.txt"); }
public static void GameDataSave() { GameDataWrite.GamePlayerSave(Players, PlayerPath + "Players.txt"); }