Exemple #1
0
 public void Simulate(ref MatchState state, MatchInputContext input)
 {
     foreach (var rule in Rules)
     {
         rule.Simulate(ref state, input);
     }
     if (BlastZone != null)
     {
         state = BlastZone.Simulate(state);
     }
     CheckForFinish(state);
 }
Exemple #2
0
 public MatchState Simulate(MatchState state, MatchInputContext input)
 {
     foreach (var rule in Rules)
     {
         state = rule.Simulate(state, input);
     }
     if (BlastZone != null)
     {
         state = BlastZone.Simulate(state);
     }
     CheckForFinish(state);
     return(state);
 }
Exemple #3
0
 public void Simulate(ref MatchState state, MatchInputContext input)
 {
     Assert.IsTrue(input.IsValid);
     Assert.AreEqual(PlayerSimulations.Length, state.PlayerCount);
     Assert.AreEqual(PlayerSimulations.Length, input.PlayerInputs.Length);
     for (var i = 0; i < state.PlayerCount; i++)
     {
         PlayerSimulations[i].Presimulate(ref state[i]);
     }
     for (var i = 0; i < state.PlayerCount; i++)
     {
         PlayerSimulations[i].Simulate(ref state[i], input.PlayerInputs[i]);
     }
 }
 public void Simulate(ref MatchState state, MatchInputContext input)
 {
     if (ActiveHitboxes.Count + ActiveHurtboxes.Count > 0)
     {
         Physics.SyncTransforms();
         CreateCollisions();
         for (var i = 0; i < Config.PlayerCount; i++)
         {
             var collisions = CollisionManager.PlayerCollisions[i];
             ApplyCollisions(collisions, ref state[i], state);
         }
     }
     CollisionManager.Clear();
     ActiveHitboxes.Clear();
     ActiveHurtboxes.Clear();
 }
Exemple #5
0
 public void Simulate(ref MatchState state, MatchInputContext input)
 {
     Assert.IsTrue(input.IsValid);
     Assert.AreEqual(PlayerSimulations.Length, state.PlayerCount);
     Assert.AreEqual(PlayerSimulations.Length, input.PlayerInputs.Length);
     for (var i = 0; i < state.PlayerCount; i++)
     {
         PlayerSimulations[i].Presimulate(state.GetPlayerState(i));
     }
     for (var i = 0; i < state.PlayerCount; i++)
     {
         var playerState = state.GetPlayerState(i);
         var simulation  = PlayerSimulations[i];
         var playerInput = input.PlayerInputs[i];
         simulation.Simulate(ref playerState, playerInput);
         state.SetPlayerState(i, playerState);
     }
 }
 public MatchState Simulate(MatchState state, MatchInputContext input)
 {
     if (ActiveHitboxes.Count + ActiveHurtboxes.Count > 0)
     {
         Physics.SyncTransforms();
         CreateCollisions();
         for (uint i = 0; i < Config.PlayerCount; i++)
         {
             var playerState = state.GetPlayerState(i);
             var collisions  = CollisionManager.PlayerCollisions[i];
             ApplyCollisions(collisions, ref playerState);
             state.SetPlayerState(i, playerState);
         }
         CollisionManager.Clear();
         ActiveHitboxes.Clear();
         ActiveHurtboxes.Clear();
     }
     return(state);
 }
 public MatchController(MatchConfig config)
 {
     inputContext = new MatchInputContext(new MatchInput(config));
 }
 public void Simulate(ref MatchState state, MatchInputContext input)
 {
     SimulationComponents.Simulate(ref state, input);
 }
Exemple #9
0
 public void Simulate(ref MatchState state, MatchInputContext input)
 {
     Simulations[state.StateID].Simulate(ref state, input);
 }
 public MatchState Simulate(MatchState state, MatchInputContext input)
 {
     return(SimulationComponents.Simulate(state, input));
 }