コード例 #1
0
ファイル: GameApp.cs プロジェクト: hkostadinov/SoftUni
        private static void SeedInitialPlayerInventory(IPlayer player)
        {
            Position defaultPosition = new Position(0, 0);

            ICollectible healthPotion = new HealthPotion(defaultPosition);
            healthPotion.State = ItemState.Collected;

            ICollectible shield = new RegularShield(defaultPosition);
            shield.State = ItemState.Collected;

            ICollectible sword = new RegularSword(defaultPosition);
            sword.State = ItemState.Collected;

            player.AddItemToInventory(healthPotion);
            player.AddItemToInventory(healthPotion);
            player.AddItemToInventory(shield);
            player.AddItemToInventory(sword);
        }
コード例 #2
0
        private static void SeedInitialPlayerInventory(IPlayer player)
        {
            Position defaultPosition = new Position(0, 0);

            ICollectible healthPotion = new HealthPotion(defaultPosition);

            healthPotion.State = ItemState.Collected;

            ICollectible shield = new RegularShield(defaultPosition);

            shield.State = ItemState.Collected;

            ICollectible sword = new RegularSword(defaultPosition);

            sword.State = ItemState.Collected;

            player.AddItemToInventory(healthPotion);
            player.AddItemToInventory(healthPotion);
            player.AddItemToInventory(shield);
            player.AddItemToInventory(sword);
        }