public List <RaceInformation> GetRaces(string eventId) { List <RaceInformation> retValue = new List <RaceInformation>(); int intEventId; if (int.TryParse(eventId, out intEventId)) { using (CX418DataAccess.cx418timingEntities context = new CX418DataAccess.cx418timingEntities()) { var races = (from t in context.Races where t.EventId == intEventId select t); foreach (var raceEntity in races) { RaceInformation newRaceInfo = new RaceInformation(raceEntity); retValue.Add(newRaceInfo); } } } return(retValue); }
public void OnRightRaceButtonPress() { raceIndex++; raceIndex = raceIndex % availableRaces.Length; raceInfo = availableRaces[raceIndex]; RefreshUI(); }
public Character(string characterName, RaceInformation race, ClassInformation clazz, Image characterImage) { this.characterName = characterName; this.race = race; this.clazz = clazz; this.characterImage = characterImage; }
private void FillDefaultUI() { if (availableRaces.Length > 0) { raceInfo = availableRaces[raceIndex]; } if (availableClasses.Length > 0) { classInfo = availableClasses[classIndex]; } }
public void OnLeftRaceButtonPress() { if (raceIndex > 1) { raceIndex--; } else { raceIndex = availableRaces.Length - 1; } raceInfo = availableRaces[raceIndex]; RefreshUI(); }
public void Run(RaceInformation raceInformation) { var dt = new DataTable(); switch (raceInformation) { case RaceInformation.GetTopDriversDetails: dt = _serviceDriver.GetTopDriversDetails(); break; case RaceInformation.GetAllDriverDetails: dt = _serviceDriver.GetAllDriverDetails(); break; default: break; } dt.Print(); }
public static void Write(List <GameObject> Players) { StreamWriter writer = new StreamWriter(path, false); RacerResults RacerInfo = new RacerResults(); for (int i = 0; i < Players.Count; i++) { string Name = Players[i].GetComponent <PlayerInformationScript>().name; string Status = Players[i].GetComponent <PlayerInformationScript>().Status; string Pos = Players[i].GetComponent <PlayerInformationScript>().CurrentPosition; string[] LapTimes = Players[i].GetComponent <PlayerInformationScript>().LapTimes; RaceInformation Info = new RaceInformation(Name, LapTimes, Pos, Status); RacerInfo.RaceInfo[i] = Info; } string json = JsonUtility.ToJson(RacerInfo); writer.Write(json); writer.Close(); }
public RaceInformation GetRace(string _id) { int intRaceId; RaceInformation retValue = null; if (int.TryParse(_id, out intRaceId)) { using (CX418DataAccess.cx418timingEntities context = new CX418DataAccess.cx418timingEntities()) { var race = (from t in context.Races where t.ID == intRaceId select t).FirstOrDefault(); if (race != null) { retValue = new RaceInformation(race); } } } return(retValue); }
public int AddRace(RaceInformation _raceInfo) { int rowChange = -1; int curIdRace = -1; using (CX418DataAccess.cx418timingEntities context = new CX418DataAccess.cx418timingEntities()) { CX418DataAccess.Race raceObj = new CX418DataAccess.Race(); raceObj.RaceName = _raceInfo.RaceName; raceObj.RaceStartingTime = _raceInfo.RaceStartingTime; raceObj.RaceStartedTime = _raceInfo.RaceStartingTime; raceObj.Description = _raceInfo.Description; raceObj.RaceLenght = _raceInfo.RaceLenght; raceObj.EventId = _raceInfo.EventId; context.Races.Add(raceObj); rowChange = context.SaveChanges(); curIdRace = raceObj.ID; } return(curIdRace); }
public void SetRaceAndClass(string characterName, RaceInformation race, ClassInformation clazz, Image characterImage) { selectedCharacter = new Character(characterName, race, clazz, characterImage); }
public Sprite GetCharacterImage(RaceInformation raceInfo, ClassInformation classInfo) { Dictionary <ClassInformation, Sprite> classImages = characterImages[raceInfo]; return(classImages[classInfo]); }