示例#1
0
        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");
        }
示例#2
0
        public static void PlayerDataSave()
        {
            string PlayerPath = Environment.CurrentDirectory + "/Data/PlayerData/" + Player.Name + "/";

            PlayerDataWrite.PlayerItemSave(Items, PlayerPath + "PlayerItem.txt");
            PlayerDataWrite.PlayerEquipmentSave(Player.Equipments, PlayerPath + "PlayerEquipment.txt");
        }