Exemple #1
0
        public void When_SimuuSensesSimuu_Expect_True()
        {
            // arrange
            SimulationLogic logic  = new SimulationLogic();
            SimuuBLL        simuu1 = MakeSampleSimuu(1);
            SimuuBLL        simuu2 = MakeSampleSimuu(2);

            bool expected = true;
            // act
            bool actual = logic.TestSenseCollision(simuu1, simuu2);

            //assert
            Assert.AreEqual(expected, actual);
        }
Exemple #2
0
        /// <summary>
        ///     Process one frame of the simulation
        /// </summary>
        public void ProcessFrame()
        {
            WorldModel world = GetModel <WorldModel>();

            //  Initialize the game logic.
            if (game == null)
            {
                game = new SimulationLogic(world, 2, 120);
            }
            else
            {
                game.ProcessTick();
            }
        }
Exemple #3
0
        public void When_SimuuDoesntSenseSimuu_Expect_False()
        {
            // arrange
            SimulationLogic logic  = new SimulationLogic();
            SimuuBLL        simuu1 = MakeSampleSimuu(1);
            SimuuBLL        simuu2 = MakeSampleSimuu(2);

            simuu2.SimuuXCoordinate = 100;
            simuu2.SimuuYCoordinate = 100;

            bool expected = false;
            // act
            bool actual = logic.TestSenseCollision(simuu1, simuu2);

            //assert
            Assert.AreNotEqual(expected, actual);
        }
        public ActionResult SimulateRound(int?id)
        {
            League league       = _db.Leagues.Find(id);
            int    currentRound = league.CurrentRound;
            Round  round        = (from r in league.Rounds.OfType <Round>() where r.RoundNumber == currentRound select r).FirstOrDefault();

            SimulationLogic sim = new SimulationLogic();

            sim.SimulateRound(round);

            foreach (Matchup matchup in round.Matchups)
            {
                RatingSystemLogic rating = new RatingSystemLogic(matchup);
            }

            using (var context = new SportsSimulatorDBEntities())
            {
                currentRound = context.spLeagues_UpdateCurrentRound(league.id);
            }

            return(RedirectToAction("Index"));
        }