Esempio n. 1
0
        public virtual void Logik()
        {
            HasStarted = true;
            if (HasStoped)
            {
                return;
            }
            Vector2i vect = Player.Play(Field);

            OnPlayerMovedEvent(vect);
            Field.SetField(vect, Player.Symbol);
            if (IsBDarstellerValid())
            {
                BDarsteller.Update(Field);
                BDarsteller.Draw();
            }
            if (HasEnd())
            {
                OnWinMessageEvent(Player.Symbol, FieldHelper.GetGameState(Field, Player));
                BDarsteller.Enabled = false;
            }
            else
            {
                PlayerChange();
                OnPlayerOutputEvent(Player.Ausgabe());
            }
        }
Esempio n. 2
0
 public void Initialize()
 {
     OnWindowTitleChangeEvent("UniTTT - " + this.ToString());
     if (IsBDarstellerValid())
     {
         BDarsteller.Update(Field);
         BDarsteller.Draw();
     }
 }
Esempio n. 3
0
 public virtual void NewGame()
 {
     Field.Initialize();
     Player = Player1;
     BDarsteller.Initialize(Field.Width, Field.Height);
     BDarsteller.Update(Field);
     BDarsteller.Draw();
     BDarsteller.Enabled = true;
     HasStoped           = false;
     HasStarted          = true;
 }