Esempio n. 1
0
        protected GameUnit(UnitBlueprint blueprint, Tile <TileInfo> currentTile)
        {
            if (!currentTile.IsValid)
            {
                throw new ArgumentOutOfRangeException();
            }

            Blueprint          = blueprint;
            anchorTile         = currentTile;
            currentMovementDir = Direction.Unknown;
            Health             = blueprint.Health;
        }
Esempio n. 2
0
        public void QueueEnemies(UnitBlueprint blueprint, int num)
        {
            var spawnTime = Game.Time + queueingDelay;

            if (spawnQueue.Count > 0 && spawnQueue.Last.Value.Item1 + timeBetweenSpawns > spawnTime)
            {
                spawnTime = spawnQueue.Last.Value.Item1 + timeBetweenSpawns;
            }

            for (var i = 0; i < num; i++)
            {
                spawnQueue.AddLast(new Tuple <Instant, UnitBlueprint>(spawnTime, blueprint));
                spawnTime += timeBetweenSpawns;
            }
        }
Esempio n. 3
0
 public EnemyUnit(UnitBlueprint blueprint, Tile <TileInfo> currentTile) : base(blueprint, currentTile)
 {
 }
Esempio n. 4
0
 private void spawnEnemy(UnitBlueprint blueprint)
 {
     this.Sync(SpawnEnemy.Command, tile, blueprint);
 }