Esempio n. 1
0
        public Brain(DrawCells draw, GameDelegate over, GameDelegate check, Btns Redraw, PlayerType playerType)
        {
            this.draw       = draw;
            this.playerType = playerType;
            this.over       = over;
            this.check      = check;
            this.ReDraw     = Redraw;

            state = State.construction;

            ships     = new List <Ship>();
            alives    = 0;
            direction = new Point(1, 0);
            isWinner  = false;

            for (int i = 0; i < 10; ++i)
            {
                for (int j = 0; j < 10; ++j)
                {
                    map[i, j] = CellState.empty;
                    notShooted.Add(10 * i + j);
                }
            }

            draw.Invoke(map);
        }
Esempio n. 2
0
 public void ChangeScene()
 {
     if (turnscreen == false)
     {
         turnscreen = true;
         Main.SetActive(false);
         Btns.SetActive(true);
     }
 }
 public static bool GetButtonUp(Btns button)
 {
     return(((data.Btn & (int)button) == 0) && ((prev_btn_state & (int)button) > 0));
 }
Esempio n. 4
0
 private void Start()
 {
     turnscreen = false;
     Main.SetActive(true);
     Btns.SetActive(false);
 }