bonhomeExamJanvier/Bonhomme02/Bonhomme.cs

69 lines
2.0 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Bonhomme02
{
class Bonhomme : Peau
{
Tete tete;
public Jambe jambe1, jambe2;
public Bras bras;
public Bonhomme() : base()
{
}
public Bonhomme(PictureBox hebergeur) : base( hebergeur)
{
}
public Bonhomme(PictureBox hebergeur, double lg, double ep, double angle) : base( hebergeur, lg, ep, angle)
{
}
public Bonhomme(PictureBox hebergeur, int xy) : base( hebergeur, xy)
{
}
public Bonhomme(PictureBox hebergeur, int x, int y, double lg, double ep, double angle) : base( hebergeur, x, y, lg, ep, angle)
{
Peau me = this;
jambe1 = new Jambe(hebergeur, ref me, lg, ep/4, Math.PI / 2); jambe2 = new Jambe(hebergeur, ref me, lg, ep / 4, Math.PI / 2); tete = new Tete(hebergeur, ref me, (int)(ep*3.5/4));
bras = new Bras(hebergeur, ref me, lg, ep/4, Math.PI / 2);
}
public Bonhomme(PictureBox hebergeur, ref Peau parent, double lg, double ep, double angle) : base( hebergeur, ref parent, lg, ep, angle)
{
}
public new void Afficher(IntPtr handle)
{
base.Afficher(handle);
tete.Afficher(handle);
jambe1.Afficher(handle);
jambe2.Afficher(handle);
bras.Afficher(handle);
}
public new void Cacher(IntPtr handle)
{
base.Cacher(handle);
tete.Cacher(handle);
jambe1.Cacher(handle);
jambe2.Cacher(handle);
bras.Cacher(handle);
}
public void InterevrtirJambe()
{
Jambe tmp;
tmp = jambe1;
jambe1 = jambe2;
jambe2 = tmp;
}
}
}