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;
        }
Пример #3
0
        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);
            }
        }
Пример #4
0
 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;
 }
Пример #5
0
        public override System.Drawing.Bitmap drawTextOnImage(SmashOverlayGenerator form)
        {
            //IF FONT IS NOT INSTALLED WE INSTALL IT

            GenFcns.installFonts(form, "EARTHQUAKE.TTF", pfc);
            GenFcns.installFonts(form, "FLAPHEAD.TTF", pfc);

            //fontsInstalled(form, "EARTHQUAKE");
            //fontsInstalled(form, "FLAPHEAD");
            //fontsInstalled(form, "zekton rg");

            setFontSizes(form.ResourceType, form.MatchupCompetitor1, form.MatchupCompetitor2);
            if (!GenFcns.isNullOrEmpty(Gametype) && Gametype.Equals("doubles"))
            {
                setFontSizes(form.ResourceType, Competitor3, Competitor4);
            }

            TournamentName  = form.TournamentName;
            TournamentRound = form.TournamentRound;
            Competitor1     = form.MatchupCompetitor1;
            Competitor2     = form.MatchupCompetitor2;

            StringFormat nameFormat       = new StringFormat();
            StringFormat tournamentFormat = new StringFormat();
            Bitmap       image            = base.getImage();
            Graphics     g = Graphics.FromImage(image);

            nameFormat.LineAlignment   = StringAlignment.Center;
            nameFormat.Alignment       = StringAlignment.Center;
            tournamentFormat.Alignment = StringAlignment.Center;

            //DRAW CHARACTERS
            drawCharactersOnImage(g, Character1Path, Character1Point, Character2Path, Character2Point);


            //DRAW BANNER
            Pen        p       = new Pen(Color.LightCyan, (float)50.0);
            SolidBrush b       = new SolidBrush(Color.MediumPurple);
            SolidBrush bBorder = new SolidBrush(Color.White);
            Rectangle  r       = new Rectangle(new Point(0, 800), new Size(1920, 200));
            Rectangle  rBorder = new Rectangle(new Point(0, 780), new Size(1920, 240));

            g.FillRectangle(bBorder, rBorder);
            g.FillRectangle(b, r);

            FontFamily earthquakeFamily = pfc.Families[0];
            FontFamily flapheadFamily   = pfc.Families[1];
            Font       earthquake       = new Font(earthquakeFamily, 120);
            Font       flaphead         = new Font(flapheadFamily, 120);

            //DRAW COMPETITOR INFORMATION
            g.DrawString(form.MatchupCompetitor1, earthquake, Brushes.White, Competitor1Point.getPoint(), nameFormat);
            g.DrawString(form.MatchupCompetitor2, earthquake, Brushes.White, Competitor2Point.getPoint(), nameFormat);
            //g.DrawString("THIS IS A TEST", f1, Brushes.Yellow, new Point(0, 0), nameFormat);
            //g.DrawString(form.TournamentName, TournamentFont, Brushes.White, TournamentPoint.getPoint(), tournamentFormat);


            //DRAW TOURNAMENT STUFFS
            string tournamentLogoPath = ListBoxFcns.getResourcePath(form.ProductName, "tournament", "*****@*****.**");
            Image  logoImage          = base.getImage(tournamentLogoPath);

            g.DrawImage(logoImage, TournamentPoint.getPoint());
            g.DrawString(form.TournamentRound, flaphead, Brushes.White, TournamentRoundPoint.getPoint(), tournamentFormat);


            Image  img      = (Image)image;
            Bitmap newImage = new Bitmap(img, new Size(640, 400));

            return(newImage);
        }