Example #1
0
 static CoachKey CreateCoachKey(MaddenRecord record)
 {
     return(new CoachKey
     {
         CoachId = record["CCID"].ToInt32(),
         Position = record["COPS"].ToInt32(),
         Team = record["TGID"].ToInt32()
     });
 }
Example #2
0
        public static void SwapHomeAwayTeam(this PreseasonScheduledGame game, MaddenRecord mr)
        {
            var realHomeTeam = game.AwayTeam;

            game.AwayTeam = game.HomeTeam;
            game.HomeTeam = realHomeTeam;
            mr["GATG"]    = game.AwayTeam.ToString();
            mr["GHTG"]    = game.HomeTeam.ToString();
        }
Example #3
0
 static SchoolRecordKey CreateSchoolRecordKey(MaddenRecord mr)
 {
     return(new SchoolRecordKey
     {
         TeamId = mr["RCDM"].ToInt32(),
         RecordDescription = mr["RCDI"].ToInt32(),
         RecordType = mr["RCDT"].ToInt32()
     });
 }
Example #4
0
 /*
  * 0 = short
  * 1 = long white
  * 2 = long black
  * 3 = long team color
  * 4 = btm 1/2 sleeve white
  * 5 = btm 1/2 sleeve black
  * 6 = btm 1/2 sleeve team color
  * 7 = top 1/2 white
  * 8  = top 1/2 black
  * 9 = top 1/2 team color
  * 10 = 3/4 white
  * 11 = 3/4 black
  * 12 = 3/4 team color
  */
 public static void FixPlayerSleeve(this MaddenRecord mr)
 {
     // if left/rigt sleeve don't match make them match
     // 1-3 may be 0 or the same
     // 4-6 may be 0 or the same
     // 7-12 must match
     if (mr.LeftSleeve() != mr.RightSleeve())
     {
         // 10 percent chance of being 0
         if (mr.RightSleeve() < 7 && Rand() < 26)
         {
             mr.AssignLeftSleeve(0);
         }
         else if (mr.RightSleeve() > 0)
         {
             mr.AssignLeftSleeve(mr.RightSleeve());
         }
     }
 }
Example #5
0
        public void TryOut(MaddenRecord mr)
        {
            var position = mr["PPOS"].ToInt32();

            if (PositionCount[position] > 0)
            {
                bool added = false;
                // for QBs we want at least 1 scrambler and 1 pocket passer
                if (position == 0)
                {
                    // we add a DTQB
                    if (!DualThreadQBAdded && mr["PTEN"].ToInt32() == 2)
                    {
                        Players.Add(mr);
                        added             = true;
                        DualThreadQBAdded = true;
                    }
                    else if (!PocketQBAdded && mr["PTEN"].ToInt32() == 0)
                    {
                        Players.Add(mr);
                        added         = true;
                        PocketQBAdded = true;
                    }
                    else if (PositionCount[position] == 3 ||
                             (PositionCount[position] == 2 && (PocketQBAdded || DualThreadQBAdded)) ||
                             (PositionCount[position] == 1 && PocketQBAdded && DualThreadQBAdded))
                    {
                        Players.Add(mr);
                        added = true;
                    }
                }
                else
                {
                    Players.Add(mr);
                    added = true;
                }

                if (added)
                {
                    PositionCount[position] = PositionCount[position] - 1;
                }
            }
        }
Example #6
0
        public RecruitPlayer(MaddenRecord mr)
        {
            var HometownValue = mr.lEntries[33].Data.ToInt32();

            this.Id           = mr.lEntries[53].Data.ToInt32();
            this.FirstName    = mr.lEntries[14].Data;
            this.LastName     = mr.lEntries[15].Data;
            this.Position     = mr["PPOS"].ToInt32();
            this.PositionRank = mr["RCPR"].ToInt32();
#if !NOCITY
            this.Hometown = City.Cities.ContainsKey(HometownValue) ? string.Format("{0}, {1}", City.Cities[HometownValue].Name, City.Cities[HometownValue].State) : "N/A";
#endif
            this.PositionName = this.Position.ToPositionName();
            var pitchRecord  = PitchTable.lRecords.Where(rec => rec.lEntries[34].Data.ToInt32() == this.Id).First();
            var commitedTeam = pitchRecord.lEntries[35].Data.ToInt32();
            this.Committed = commitedTeam != 1023;
            this.TopTeam   = pitchRecord.lEntries[6].Data.ToInt32().ToTeamName();
            this.TopTeamId = pitchRecord.lEntries[6].Data.ToInt32();
        }
Example #7
0
 static int CreateCoachSkillKey(MaddenRecord record)
 {
     return(record["CCID"].ToInt32());
 }
Example #8
0
 public static void AssignLeftSleeve(this MaddenRecord mr, int num)
 {
     mr["PLSL"] = num.ToString();
 }
Example #9
0
 public static int LeftSleeve(this MaddenRecord mr)
 {
     return(mr["PLSL"].ToInt32());
 }
Example #10
0
 public static int TeamId(this MaddenRecord mr)
 {
     return(mr["TGID"].ToInt32());
 }
Example #11
0
 public static int Overall(this MaddenRecord mr)
 {
     return(mr["POVR"].ToInt32());
 }
Example #12
0
 public static int Position(this MaddenRecord mr)
 {
     return(mr["PPOS"].ToInt32());
 }
Example #13
0
 public static void AssignJerseuNumber(this MaddenRecord mr, int num)
 {
     mr["PJEN"] = num.ToString();
 }
Example #14
0
 public static int JerseyNumber(this MaddenRecord mr)
 {
     return(mr["PJEN"].ToInt32());
 }
Example #15
0
 public static bool IsNewFrosh(MaddenRecord mr)
 {
     return(mr["PYEA"].ToInt32() == 0 && mr["PRSD"].ToInt32() == 0);
 }
Example #16
0
        static bool IsValidTeam(this MaddenRecord record)
        {
            var teamId = record["TGID"].ToInt32();

            return(teamId.IsValidTeam());
        }
Example #17
0
 public TeamData(MaddenRecord record)
 {
     this.Data = record.lEntries.ToDictionary(rc => rc.GetFieldName(), rc => rc.Data);
 }
Example #18
0
 public static int RightSleeve(this MaddenRecord mr)
 {
     return(mr["PLSR"].ToInt32());
 }