public CompetitorTemplate(string filePath, CompetitorPoint competitor1, CompetitorPoint competitor2, ScorePoint score1, ScorePoint score2, TournamentPoint tournamentNameRound) : base(filePath) { if (competitor1 == null) { throw new Exception("Competitor Template: Competitor 1 must have a point on template"); } if (competitor2 == null) { throw new Exception("Competitor Template: Competitor 2 must have a point on template"); } if (score1 == null) { throw new Exception("Competitor Template: Score 1 must have a point on template"); } if (score2 == null) { throw new Exception("Competitor Template: Score 2 must have a point on template"); } if (tournamentNameRound == null) { throw new Exception("Competitor Template: Tournament Name must have a point on template"); } this.competitor1Point = competitor1; this.competitor2Point = competitor2; this.score1Point = score1; this.score2Point = score2; this.tournamentNameRoundPoint = tournamentNameRound; }
public CompetitorTemplate(string filePath, CompetitorPoint competitor1, CompetitorPoint competitor2, CompetitorPoint competitor1Webcam, CompetitorPoint competitor2Webcam, ScorePoint score1, ScorePoint score2, RoundPoint round, TournamentPoint tournamentNameRound, DatePoint datePoint) : base(filePath) { if (competitor1 == null) { throw new Exception("Competitor Template: Competitor 1 must have a point on template"); } if (competitor2 == null) { throw new Exception("Competitor Template: Competitor 2 must have a point on template"); } if (competitor1Webcam == null) { throw new Exception("Competitor Template: Competitor 1's Webcam must have a point on template"); } if (competitor2Webcam == null) { throw new Exception("Competitor Template: Competitor 2's Webcam must have a point on template"); } if (score1 == null) { throw new Exception("Competitor Template: Score 1 must have a point on template"); } if (score2 == null) { throw new Exception("Competitor Template: Score 2 must have a point on template"); } if (round == null) { throw new Exception("Competitor Template: Round must have a point on template"); } if (tournamentNameRound == null) { throw new Exception("Competitor Template: Tournament Name must have a point on template"); } if (datePoint == null) { throw new Exception("Competitor Template: Date must have a point on template"); } this.competitor1Point = competitor1; this.competitor2Point = competitor2; this.competitor1WebcamPoint = competitor1Webcam; this.competitor2WebcamPoint = competitor2Webcam; this.score1Point = score1; this.score2Point = score2; this.roundPoint = round; this.tournamentNameRoundPoint = tournamentNameRound; this.datePoint = datePoint; }
public static CompetitorTemplate GetCompTemplate(string fileName) { string qry = "SELECT * FROM tbl_CompetitorTemplates WHERE FileName = '" + fileName + "';"; SQLiteCommand cmd = new SQLiteCommand(qry, conn); try { DBOpen(); SQLiteDataReader cur = cmd.ExecuteReader(); while (cur.Read()) { string name = cur.GetString(0); int tpx = cur.GetInt32(1); int tpy = cur.GetInt32(2); int rpx = cur.GetInt32(3); int rpy = cur.GetInt32(4); int p1px = cur.GetInt32(5); int p1py = cur.GetInt32(6); int p2px = cur.GetInt32(7); int p2py = cur.GetInt32(8); int p1cpx = cur.GetInt32(9); int p1cpy = cur.GetInt32(10); int p2cpx = cur.GetInt32(11); int p2cpy = cur.GetInt32(12); int p1spx = cur.GetInt32(13); int p1spy = cur.GetInt32(14); int p2spx = cur.GetInt32(15); int p2spy = cur.GetInt32(16); int dpx = cur.GetInt32(17); int dpy = cur.GetInt32(18); string opt = cur.GetString(19).Replace("\n", ""); CompetitorPoint player1pt = new CompetitorPoint(p1px, p1py); CompetitorPoint player2pt = new CompetitorPoint(p2px, p2py); CompetitorPoint player1CamPt = new CompetitorPoint(p1cpx, p1cpy); CompetitorPoint player2CamPt = new CompetitorPoint(p2cpx, p2cpy); ScorePoint score1pt = new ScorePoint(p1spx, p1spy); ScorePoint score2pt = new ScorePoint(p2spx, p2spy); RoundPoint roundpt = new RoundPoint(rpx, rpy); TournamentPoint tourneypt = new TournamentPoint(tpx, tpy); DatePoint datePoint = new DatePoint(dpx, dpy); DBClose(); return(new CompetitorTemplate(name, player1pt, player2pt, player1CamPt, player2CamPt, score1pt, score2pt, roundpt, tourneypt, datePoint, opt)); } return(null); } catch (Exception ex) { DBClose(); return(null); } }
public MatchupPictureTemplate(string filePath, string gametype, TournamentPoint tournamentPoint, TournamentPoint tournamentRoundPoint, string character1Path, CharacterPoint character1Point, CompetitorPoint competitor1Point, string character2Path, CharacterPoint character2Point, CompetitorPoint competitor2Point) : base(filePath) { this.tournamentPoint = tournamentPoint; this.tournamentRoundPoint = tournamentRoundPoint; this.character1Path = character1Path; this.character2Path = character2Path; this.competitor1Point = competitor1Point; this.competitor2Point = competitor2Point; this.character1Point = character1Point; this.character2Point = character2Point; }