private void Construct(Unit builder, TilePosition buildSite, ConstructBuildingStep 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()); }
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())); }); }