Ejemplo n.º 1
0
 public Bateau(TypeBateau unType, int unNbre, bool unEtat, int unNbreCaseTouche, Position[] Tableau)
 {
     leType = unType;
     NbreCases = unNbre;
     Detruit = unEtat;
     NbreCasesTouche = unNbreCaseTouche;
     Tab = Tableau;
 }
Ejemplo n.º 2
0
 public Flotte(Position[] a_BattleShip, Position[] a_Destroyeur, Position[] a_Submarine, Position[] a_Aircraft, Position[] a_Patrol, TypeFlotte leType)
 {
     BattleShip = new Bateau(TypeBateau.BattleShip, 5, false, 0, a_BattleShip);
     Destroyeur = new Bateau(TypeBateau.Destroyer, 4, false, 0, a_Destroyeur);
     Submarine = new Bateau(TypeBateau.Submarine, 3, false, 0, a_Submarine);
     Aircraft = new Bateau(TypeBateau.AircraftCarrier, 3, false, 0, a_Aircraft);
     Patrol = new Bateau(TypeBateau.PatrolBoat, 2, false, 0, a_Patrol);
     unType = leType;
 }
 private void SetLesTrucs(int index, char lettre, int nombre, bool etat, Position[] tab)
 {
     tab[index].letter = lettre;
     tab[index].number = nombre;
     tab[index].touche = etat;
 }
        private void InitializeFlotte()
        {
            Position[] tabAircraft = new Position[3]; // 3
            SetLesTrucs(0, 'A', 0, false, tabAircraft);
            SetLesTrucs(1, 'A', 1, false, tabAircraft);
            SetLesTrucs(2, 'A', 2, false, tabAircraft);

            Position[] tabBattleShip = new Position[5]; // 5
            SetLesTrucs(0, 'B', 0, false, tabBattleShip);
            SetLesTrucs(1, 'B', 1, false, tabBattleShip);
            SetLesTrucs(2, 'B', 2, false, tabBattleShip);
            SetLesTrucs(3, 'B', 3, false, tabBattleShip);
            SetLesTrucs(4, 'B', 4, false, tabBattleShip);

            Position[] tabDestroyeur = new Position[4]; // 4
            SetLesTrucs(0, 'C', 0, false, tabDestroyeur);
            SetLesTrucs(1, 'C', 1, false, tabDestroyeur);
            SetLesTrucs(2, 'C', 2, false, tabDestroyeur);
            SetLesTrucs(3, 'C', 3, false, tabDestroyeur);

            Position[] tabSubmarine = new Position[3]; // 3
            SetLesTrucs(0, 'D', 0, false, tabSubmarine);
            SetLesTrucs(1, 'D', 1, false, tabSubmarine);
            SetLesTrucs(2, 'D', 2, false, tabSubmarine);

            Position[] tabPatrol = new Position[2]; // 2
            SetLesTrucs(0, 'E', 0, false, tabPatrol);
            SetLesTrucs(1, 'E', 1, false, tabPatrol);

            maFlotte = new Flotte(tabAircraft, tabBattleShip, tabDestroyeur, tabSubmarine, tabPatrol, TypeFlotte.allier);
        }