Example #1
0
        public void CannotDrillMineOrDestroyedOutpost()
        {
            DrillMineEvent drillMine       = new DrillMineEvent(_model1);
            DrillMineEvent drillSecondMine = new DrillMineEvent(_model2);
            DrillMineEvent drillMineAgain  = new DrillMineEvent(new GameEventModel()
            {
                EventData = new DrillMineEventData()
                {
                    SourceId = _o1.GetComponent <IdentityManager>().GetId()
                }.ToByteString(),
                Id           = Guid.NewGuid().ToString(),
                EventType    = EventType.DrillMineEvent,
                OccursAtTick = 25
            });

            _o1.GetComponent <DrillerCarrier>().AddDrillers(150);
            _o2.GetComponent <DrillerCarrier>().AddDrillers(300);
            _o2.GetComponent <DrillerCarrier>().Destroy();
            _tm.AddEvent(drillMine);
            _tm.AddEvent(drillMineAgain);
            _tm.AddEvent(drillSecondMine);
            _tm.Advance(25);
            Assert.IsFalse(drillMineAgain.WasEventSuccessful());
            Assert.IsFalse(drillSecondMine.WasEventSuccessful());
        }
Example #2
0
        public void CannotDrillWithInsufficientDrillers()
        {
            DrillMineEvent drillMine = new DrillMineEvent(_model1);

            _tm.AddEvent(drillMine);
            _tm.Advance(10);
            Assert.IsFalse(drillMine.WasEventSuccessful());
        }
Example #3
0
        public void MiningCostIncreases()
        {
            _o1.GetComponent <DrillerCarrier>().AddDrillers(50);
            _o2.GetComponent <DrillerCarrier>().AddDrillers(50);
            DrillMineEvent drillFirstMine  = new DrillMineEvent(_model1);
            DrillMineEvent drillSecondMine = new DrillMineEvent(_model2);

            _tm.AddEvent(drillFirstMine);
            _tm.AddEvent(drillSecondMine);
            _tm.Advance(20);
            Assert.IsTrue(drillFirstMine.WasEventSuccessful());
            Assert.IsFalse(drillSecondMine.WasEventSuccessful());
            _tm.Rewind(20);
            _o2.GetComponent <DrillerCarrier>().AddDrillers(100);
            _tm.Advance(20);
            Assert.IsTrue(drillSecondMine.WasEventSuccessful());
            Assert.AreEqual(200, _o1.GetComponent <DrillerCarrier>().GetOwner().GetRequiredDrillersToMine());
        }
Example #4
0
        public void DrillFirstMine()
        {
            _o1.GetComponent <DrillerCarrier>().AddDrillers(50);
            DrillMineEvent drillMine = new DrillMineEvent(_model1);

            _tm.AddEvent(drillMine);
            _tm.Advance(10);
            Assert.IsTrue(drillMine.WasEventSuccessful());
            Assert.IsFalse(_tm.GetState().GetOutposts().Contains(_o1));
        }