Example #1
0
 public Game(Team teamHome, Team teamAway, Ball ball, Playground playground)
 {
     TeamHome   = teamHome;
     TeamAway   = teamAway;
     _ball      = ball;
     Playground = playground;
     FindPlayersDefaultZone();
     GameEngine.CurrentGame = this;
 }
Example #2
0
 public Game(Team teamHome, Team teamAway, Ball ball, Playground playground)
 {
     TeamHome = teamHome;
     TeamAway = teamAway;
     _ball = ball;
     Playground = playground;
     FindPlayersDefaultZone();
     GameEngine.CurrentGame = this;
 }
 public static void Init()
 {
     TestBall = new Ball();
     TestPlayground = new Playground("Anfield");
     InitPlayers();
     TestTeamHome = new Team(TeamScheme.Home451,new BalancedStrategy(),playersHome);
     TestTeamAway = new Team(TeamScheme.Away451,new BalancedStrategy(),playersAway);
     TestBall.AttachObserver(TestTeamAway);
     TestBall.AttachObserver(TestTeamHome);
     TestGame = new Game(TestTeamHome,TestTeamAway,TestBall,TestPlayground);
 }
Example #4
0
 public Player(
     string name,
     PlayerType type,
     Playground playground,
     int number,
     int speedPoints,
     int defensePoints,
     int dribblePoints,
     int shootPowerPoints,
     int shootAccuracyPoints
     )
 {
     Name                = name;
     _state              = PlayerState.Free;
     Type                = type;
     _playground         = playground;
     Number              = number;
     SpeedPoints         = speedPoints;
     DefensePoints       = defensePoints;
     DribblePoints       = dribblePoints;
     ShootAccuracyPoints = shootAccuracyPoints;
     ShootPowerPoints    = shootPowerPoints;
 }