Ejemplo n.º 1
0
        private void Construct(Unit builder, TilePosition buildSite, HatcheryBuildingStep constructStep)
        {
            if (!Game.IsExplored(buildSite))
            {
                builder.Move(buildSite.ToPixelTile(), false);
                return;
            }

            builder.Build(constructStep.Target, buildSite);
            _constructionStarted.Where(x => x == constructStep.Target).Take(1).Subscribe(x =>
            {
                constructStep.Complete();
                // TODO: problem, if we start constructing another instance of the same building before, we complete the step prematurely
                _gameInfo.MyBases.Add(new MyBase(GetBuildRegion(constructStep), constructStep.HatcheryType.ToBaseType()));
            });
        }