Пример #1
0
 public EnemyClass(int x, int y, userTileClass.tileType type, int damage, int hp) : base(x, y, type)
 {
     overallUserFinalDamage(damage);
     setHp(hp);
     setMaxHp(hp);
     this.type = userTileClass.tileType.Enemy;
 }
        private userTileClass create(userTileClass.tileType type)
        {
            int[] spawnLocation = fetchSpawnPosition();

            if (type == userTileClass.tileType.Hero)
            {
                return(new HeroClass(spawnLocation[1], spawnLocation[0], 10));
            }

            else if (type == userTileClass.tileType.Enemy)

            {
                return(enemyGen(spawnLocation[1], spawnLocation[0]));
            }

            else if (type == userTileClass.tileType.Gold)

            {
                return(new GoldClass(spawnLocation[1], spawnLocation[0]));
            }

            else

            {
                return(new emptyUserTileClass(spawnLocation[1], spawnLocation[0]));
            }
        }