コード例 #1
0
        public Form1()
        {
            InitializeComponent();

            if (File.Exists(PLAYER_DATA_FILE_NAME))
            {
                player = Player.CreatePlayerFromXmlString(File.ReadAllText(PLAYER_DATA_FILE_NAME));
            }
            else
            {
                player = Player.CreateDefaultPlayer();
            }
            MoveTo(player.CurrentLocation);

            lblHitPoints.DataBindings.Add("Text", player, "CurrentHP");
            lblGold.DataBindings.Add("Text", player, "Gold");
            lblExperience.DataBindings.Add("Text", player, "XP");
            lblLevel.DataBindings.Add("Text", player, "Level");
        }