Ejemplo 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;
        }
Ejemplo 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;
            }
        }
Ejemplo n.º 3
0
 public EnemyUnit(UnitBlueprint blueprint, Tile <TileInfo> currentTile) : base(blueprint, currentTile)
 {
 }
Ejemplo n.º 4
0
 private void spawnEnemy(UnitBlueprint blueprint)
 {
     this.Sync(SpawnEnemy.Command, tile, blueprint);
 }