C# Class FootballSimulation.Simulation

Represents a simulation of an indoor football game.
Inheritance: ISimulation
Show file Open project: PurdueSIGAI/Soccer Class Usage Examples

Public Methods

Method Description
Simulate ( float time ) : void

Simulates one step of the football game.

Simulation ( ReadOnlyCollection teams, PointMass ball, RectangleF pitchBounds, float friction ) : System

Initializes a new instance of the Simulation class.

Private Methods

Method Description
OnGoalScored ( Team scoringTeam ) : void
OnReset ( ) : void
ResolveBallDirection ( IEnumerable kicks ) : Vector2
SimulateBall ( float time, IEnumerable kicks ) : void
SimulatePlaying ( float time ) : void
SimulateResetting ( float time ) : void

Method Details

Simulate() public method

Simulates one step of the football game.
public Simulate ( float time ) : void
time float The time step length.
return void

Simulation() public method

Initializes a new instance of the Simulation class.
public Simulation ( ReadOnlyCollection teams, PointMass ball, RectangleF pitchBounds, float friction ) : System
teams ReadOnlyCollection The teams to be played against each other.
ball PointMass The ball.
pitchBounds System.Drawing.RectangleF The pitch boundaries.
friction float The friction coefficient.
return System