Exemple #1
0
 public Lineup(int pg, int sg, int sf, int pf, int c, GameSituation checkInGame, string desc, int homeAway)
 {
     HomeAway = homeAway;
     Desc     = desc;
     PG       = pg;
     SG       = sg;
     SF       = sf;
     PF       = pf;
     C        = c;
     Active   = true;
     InOut.Add(new CheckinCheckout(this.HomeAway, checkInGame));
 }
Exemple #2
0
 public void Playing(int team, GameSituation game)
 {
     //if within the same quarter just extend the current check in. if not, check that one out and create a new one
     if (InOut.Last().CheckInGame.CurrentQuarter == game.CurrentQuarter)
     {
         if (game.SecondsRemaining > InOut.Last().CheckInGame.SecondsRemaining)
         {
             game.SecondsRemaining = 0;
         }
         InOut.Last().CheckOutGame = game;
         Active = true;
     }
     else
     {
         CheckIn(team, game);
         Active = true;
     }
 }
Exemple #3
0
        public GameSituation ToGameSituation(int team)
        {
            var gameSituation = new GameSituation();

            var opponent = team == 0 ? 1 : 0;

            gameSituation.CurrentQuarter   = CurrentQuarter;
            gameSituation.SecondsRemaining = SecondsRemaining;
            foreach (var prop in gameSituation.Team.GetType().GetProperties())
            {
                var gamProp   = Teams[team].GetType().GetProperty(prop.Name);
                var gameValue = gamProp.GetValue(Teams[team], null);
                prop.SetValue(gameSituation.Team, gameValue, null);
            }

            foreach (var prop in gameSituation.OpposingTeam.GetType().GetProperties())
            {
                var gameProp  = Teams[opponent].GetType().GetProperty(prop.Name);
                var gameValue = gameProp.GetValue(Teams[opponent], null);
                prop.SetValue(gameSituation.OpposingTeam, gameValue, null);
            }

            return(gameSituation);
        }
Exemple #4
0
 public void CheckIn(int team, GameSituation game)
 {
     InOut.Add(new CheckinCheckout(team, game));
     Active = true;
 }
Exemple #5
0
 public CheckinCheckout(int team, GameSituation checkInGame)
 {
     CheckInGame  = checkInGame;
     CheckOutGame = checkInGame;
     ThisTeam     = team;
 }