Ejemplo n.º 1
0
        public Nave(Type type, Orientamento orientamento)
        {
            this.type         = type;
            this.orientamento = orientamento;
            switch (this.type)
            {
            case Type.da2:
                dimensione = 2;
                break;

            case Type.da3:
                dimensione = 3;
                break;

            case Type.da4:
                dimensione = 4;
                break;

            case Type.da5:
                dimensione = 5;
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }

            nave = new CellType[dimensione];
            for (var i = 0; i < nave.Length; i++)
            {
                nave[i] = CellType.Integra;
            }
        }
Ejemplo n.º 2
0
 public void toggleOrientamento()
 {
     orientamento = orientamento == Orientamento.Orizzontale ? Orientamento.Verticale : Orientamento.Orizzontale;
 }
Ejemplo n.º 3
0
 public void setOrientamento(Orientamento o)
 {
     orientamento = o;
 }