Beispiel #1
0
 internal void OnGameStop(GameStopReason reason, User player)
 {
     _game             = null;
     _playerController = null;
     OnPropertyChanged();
     UIDispatcher.Invoke(GameStop, reason, player);
 }
Beispiel #2
0
 public void Init(GameOutward game)
 {
     reportViewer.Document = Battling;
     game.LogAppended     += controller.GameLogAppended;
     game.TurnEnd         += controller.TurnEnd;
     game.GameEnd         += () => reportViewer.Document = Full;
     game.Error           += (e) =>
     {
         controller.AddText(GameString.Current.BattleLog(Ls.CERROR), Brushes.OrangeRed);
     };
 }
Beispiel #3
0
 internal void Reset()
 {
     _game             = null;
     _playerController = null;
     InputRequest      = null;
     _prepare00        = false;
     _prepare01        = false;
     _prepare10        = false;
     _prepare11        = false;
     OnPropertyChanged();
 }
Beispiel #4
0
 public ControlPanelVM(RoomController c)
 {
     Controller = c.PlayerController;
     Game       = c.Game;
     //if (Game.Settings.Mode == GameMode.Multi) Partner = 2 - Controller.Player.TeamIndex;
     if (Game.Settings.Mode.NeedTarget())
     {
         _targetPanel = new TargetPanelVM(Controller.Player.Team);
     }
     Timer = new DispatcherTimer()
     {
         Interval = TimeSpan.FromSeconds(1)
     };
     _time                    = 180;
     _selectedPanel           = INACTIVE;
     _pokemons                = new SimPokemon[6];
     Controller.RequireInput += RequireInput;
     c.Game.GameEnd          += () => Timer.Stop();
     Timer.Tick              += (sender, e) => Time--;
 }
Beispiel #5
0
        internal void GameStart(ReportFragment gf)
        {
            Dictionary <int, string> ps = new Dictionary <int, string>();
            var mi = Room.Settings.Mode.PlayersPerTeam();

            string[,] players = new string[2, mi];
            for (int t = 0; t < 2; ++t)
            {
                for (int i = 0; i < mi; ++i)
                {
                    players[t, i] = Room[t, i].Name;
                }
            }
            if (User.Seat != Seat.Spectator)
            {
                PlayerController = new PlayerController(this, Self, Partner);
                Partner          = null;
            }
            Game = new GameOutward(Room.Settings, players, gf);
            Game.Start();
        }