Example #1
0
        public void RewindTest()
        {
            _o1.GetComponent <DrillerCarrier>().AddDrillers(50);
            DrillMineEvent drillMine = new DrillMineEvent(_model1);

            _tm.AddEvent(drillMine);
            _tm.Advance(10 + 1440 / (int)GameTick.MinutesPerTick);
            _tm.Rewind(10 + 1440 / (int)GameTick.MinutesPerTick);
            Assert.IsTrue(_tm.GetState().GetOutposts().Contains(_o1));
            Assert.AreEqual(0, _p.GetNeptunium());
            Assert.AreEqual(0, _tm.GetCurrentTick().GetTick());
            Assert.AreEqual(Constants.InitialDrillersPerOutpost + 50, _o1.GetComponent <DrillerCarrier>().GetDrillerCount());
        }
        public void ProductionEventSuccess()
        {
            FactoryProduction p = null;

            foreach (GameEvent e in _tm.GetQueuedEvents())
            {
                if (e is FactoryProduction)
                {
                    p = (FactoryProduction)e;
                    break;
                }
            }

            var player        = _f.GetComponent <DrillerCarrier>().GetOwner();
            var totalDrillers = _game.TimeMachine.GetState().GetPlayerDrillerCount(player);
            var drillerCap    = _game.TimeMachine.GetState().GetPlayerDrillerCapacity(player);

            Assert.IsNotNull(p);
            Assert.IsTrue(totalDrillers < drillerCap);
            _tm.GoTo(p.GetOccursAt().Advance(10));
            Assert.IsTrue(_tm.GetCurrentTick().GetTick() > p.GetOccursAt().GetTick());
            Assert.IsTrue(p.WasEventSuccessful());
        }