public List <CardStruct.Race> generateCardStructFullCard() //*** { //all races of 1 track List <CardStruct.Race> allRacesOnaTrack = new List <CardStruct.Race>(); int hCounter = 0; // horse id will start at 1 for all track int raceCount = numberOfRacesPerTrack(); for (int r = 1; r <= raceCount; r++) { CardStruct.Race oneRaceNode = new CardStruct.Race(); oneRaceNode.raceNumber = "" + r; oneRaceNode.allHorsesWithRaceHeader = new List <CardStruct.HorseOrHeader>(); //for loop for horse-series int horseCount = numberOfHorsePerRace(); // if (r == 3 || r == 4) horseCount = 4;//debug case for multiple header on one page override for (int hh = 0; hh <= horseCount; hh++) { CardStruct.HorseOrHeader horseORheader = new CardStruct.HorseOrHeader(); horseORheader.Height = generateHorsOrHeaderDepth(); // if (r == 5 && hh == 4) horseORheader.Height = 2000;//debug case for very large horse override // if (r == 5 && hh == 1) horseORheader.Height = 2000;//debug case for very large horse immediate to header horseORheader.racenum = r; if (hh == 0) //header { horseORheader.Id = 0; horseORheader.IsHeader = true; } else { horseORheader.Id = ++hCounter; } if (hh == 1) //1st horse { horseORheader.IsFirstHorseOfRace = true; } else if (hh == horseCount) //last { horseORheader.IsLastHorseOfRace = true; } //last horse of last race if ((r == raceCount) && (hh == horseCount)) { //horseORheader.IsLastHorseOfTheCard = true; horseORheader.IsLastHorseOfTheCard = false; //to debug simulate actual program if does not mark IsLastHorseOfTheCard = true. part of simulation correctly done in prepInput() } oneRaceNode.allHorsesWithRaceHeader.Add(horseORheader); } allRacesOnaTrack.Add(oneRaceNode); } return(allRacesOnaTrack); }
internal Header(CardStruct.HorseOrHeader h) : this(h.Height, h.FileName, null, h.racenum, null, h.IsHeader) { }
internal Horse(CardStruct.HorseOrHeader h) : this(h.Id, h.Height, h.FileName, null, h.racenum, null, h.IsFirstHorseOfRace, h.IsLastHorseOfRace, h.IsLastHorseOfTheCard) { }