Example #1
0
        public override void afficher(object sender, PaintEventArgs e, ICaseImageFlyweight fw, int x, int y)
        {
            if (Case.Units.OfType<StudentINFO>().Count() != 0)
            {
                if (Case.Units.OfType<BossINFO>().Count() != 0)
                    e.Graphics.DrawImage(fw.getUnitImage(8, Player.Color), x + 23, y + 23, 25, 25);
                else
                    e.Graphics.DrawImage(fw.getUnitImage(5, Player.Color), x + 23, y + 23, 25, 25);

                //Affichage du nombre d'unités du même type
                if (Case.Units.OfType<TeacherINFO>().Count() > 1)
                {
                    e.Graphics.DrawString(Case.Units.OfType<TeacherINFO>().Count().ToString(), new Font("Arial", 7, FontStyle.Bold), new SolidBrush(Color.Black), x + 37, y + 37);
                    e.Graphics.DrawString(Case.Units.OfType<TeacherINFO>().Count().ToString(), new Font("Arial", 6), new SolidBrush(Color.White), x + 37, y + 37);
                }
            }
            else
            {
                if (Case.Units.OfType<BossINFO>().Count() != 0)
                    e.Graphics.DrawImage(fw.getUnitImage(7, Player.Color), x + 6, y + 6, 38, 38);
                else
                    e.Graphics.DrawImage(fw.getUnitImage(6, Player.Color), x + 6, y + 6, 38, 38);

                //Affichage du nombre d'unités du même type
                if (Case.Units.OfType<TeacherINFO>().Count() > 1)
                {
                    e.Graphics.DrawString(Case.Units.OfType<TeacherINFO>().Count().ToString(), new Font("Arial", 11, FontStyle.Bold), new SolidBrush(Color.Black), x + 28, y + 28);
                    e.Graphics.DrawString(Case.Units.OfType<TeacherINFO>().Count().ToString(), new Font("Arial", 10), new SolidBrush(Color.White), x + 28, y + 28);
                }
            }
        }
Example #2
0
 public override void afficher(object sender, PaintEventArgs e, ICaseImageFlyweight fw, int x, int y)
 {
     if (Case.Units.Count == 1)
     {
         e.Graphics.DrawImage(fw.getUnitImage(0, Player.Color), x + 6, y + 6, 38, 38);
     }
 }