public void RemoveTest() { var model = new BsFactions(_actors.Object); model.Add(_actor1.Object, BsFaction.Blue); model.Add(_actor1.Object, BsFaction.Red); model.Add(_actor1.Object, BsFaction.Green); model.Remove(_actor1.Object, BsFaction.Blue); Assert.IsFalse(model.Contains(_actor1.Object, BsFaction.Blue)); Assert.IsTrue(model.Contains(_actor1.Object, BsFaction.Red)); Assert.IsTrue(model.Contains(_actor1.Object, BsFaction.Green)); model.Remove(_actor1.Object, BsFaction.Blue); Assert.IsFalse(model.Contains(_actor1.Object, BsFaction.Blue)); Assert.IsTrue(model.Contains(_actor1.Object, BsFaction.Red)); Assert.IsTrue(model.Contains(_actor1.Object, BsFaction.Green)); model.Remove(_actor1.Object, BsFaction.Red); Assert.IsFalse(model.Contains(_actor1.Object, BsFaction.Blue)); Assert.IsFalse(model.Contains(_actor1.Object, BsFaction.Red)); Assert.IsTrue(model.Contains(_actor1.Object, BsFaction.Green)); model.Remove(_actor1.Object, BsFaction.Green); Assert.IsFalse(model.Contains(_actor1.Object, BsFaction.Blue)); Assert.IsFalse(model.Contains(_actor1.Object, BsFaction.Red)); Assert.IsFalse(model.Contains(_actor1.Object, BsFaction.Green)); }
public void AreAlliesGroupsTest() { var model = new BsFactions(_actors.Object); model.Add(_actor1.Object, BsFaction.Green | BsFaction.Blue); model.Add(_actor2.Object, BsFaction.Red | BsFaction.Blue); Assert.IsTrue(model.AreAllies(_actor1.Object, _actor2.Object)); }
public void AreAlliesTest() { var model = new BsFactions(_actors.Object); model.Add(_actor1.Object, BsFaction.Blue); model.Add(_actor2.Object, BsFaction.Blue); Assert.IsTrue(model.AreAllies(_actor1.Object, _actor2.Object)); model.Remove(_actor2.Object, BsFaction.Blue); Assert.IsFalse(model.AreAllies(_actor1.Object, _actor2.Object)); }
public void AddAllFactionsTest() { var model = new BsFactions(_actors.Object); model.Add(_actor1.Object, BsFaction.Blue); model.Add(_actor1.Object, BsFaction.Red); model.Add(_actor1.Object, BsFaction.Green); Assert.IsFalse(model.AreAllies(_actor1.Object, _actor2.Object)); Assert.IsTrue(model.Contains(_actor1.Object, BsFaction.Blue)); Assert.IsTrue(model.Contains(_actor1.Object, BsFaction.Red)); Assert.IsTrue(model.Contains(_actor1.Object, BsFaction.Green)); }
public void FactionsTest() { var model = new BsFactions(_actors.Object); model.Add(_actor1.Object, BsFaction.Green | BsFaction.Blue); model.Factions(_actor2.Object); Assert.AreEqual("Green, Blue", model.Factions(_actor1.Object).ToString()); }
public override void DidEnter(IState state) { // Setup the board var board = new BsBoard2D(10, 10); // Create actors and add them to the board var actors = new BsActorCollection(); var red1 = actors.Add(_config.Fighter); var red2 = actors.Add(_config.Fighter); var red3 = actors.Add(_config.Fighter); var blue1 = actors.Add(_config.Archer); var blue2 = actors.Add(_config.Fighter); var blue3 = actors.Add(_config.Archer); board.Add(red1, 0); board.Add(red2, 5); board.Add(red3, 9); board.Add(blue1, 90); board.Add(blue2, 95); board.Add(blue3, 99); // Setup models var levels = new BsLevels(actors); var stats = new BsStatsModel(levels); var health = new BsHealthModel(actors, stats); var range = new BsRange(board, _config.DstConfig); var factions = new BsFactions(actors); // Add actors to factions factions.Add(red1, BsFaction.Red); factions.Add(red2, BsFaction.Red); factions.Add(red3, BsFaction.Red); factions.Add(blue1, BsFaction.Blue); factions.Add(blue2, BsFaction.Blue); factions.Add(blue3, BsFaction.Blue); // Setup levels levels.AddLevel(actors.Actor(1), 5); levels.AddLevel(actors.Actor(2), 10); levels.AddLevel(actors.Actor(3), 15); levels.AddLevel(actors.Actor(4), 20); // Facade model var model = new BsModel(actors); model.AddSubmodel(health); model.AddSubmodel(board); model.AddSubmodel(levels); model.AddSubmodel(range); model.AddSubmodel(factions); _model = model; // Presenter _presenter = new BsPresenter(_view, _hudView, _model, _input, _logger); _presenter.Init(); _logger.Log("Battle Simulation Ready"); }