예제 #1
0
        public PlayerHelper(IASL game, IPlayerHelperUI playerUI, bool useBuffer)
        {
            m_playerUI = playerUI;
            m_game = game;
            m_useBuffer = useBuffer;

            m_game.PrintText += m_game_PrintText;

            m_gameTimer = m_game as IASLTimer;
        }
예제 #2
0
        public PlayerHelper(IASL game, IPlayerHelperUI playerUI)
        {
            UseGameColours = true;
            UseGameFont = true;
            m_playerUI = playerUI;
            m_game = game;

            m_game.PrintText += m_game_PrintText;

            m_gameTimer = m_game as IASLTimer;
        }
예제 #3
0
        public PlayerHelper(IASL game, IPlayerHelperUI playerUI)
        {
            UseGameColours = true;
            UseGameFont    = true;
            m_playerUI     = playerUI;
            m_game         = game;

            m_game.PrintText += m_game_PrintText;

            m_gameTimer = m_game as IASLTimer;
        }
예제 #4
0
        public ConsolePlayer(IASL game)
        {
            m_game = game;

            m_gameTimer = game as IASLTimer;
            if (m_gameTimer != null)
            {
                m_timer           = new System.Timers.Timer(1000);
                m_timer.Elapsed  += timer_Elapsed;
                m_timer.AutoReset = true;
                m_gameTimer.RequestNextTimerTick += game_RequestNextTimerTick;
            }
        }
예제 #5
0
        public ConsolePlayer(IASL game)
        {
            m_game = game;

            m_gameTimer = game as IASLTimer;
            if (m_gameTimer != null)
            {
                m_timer = new System.Timers.Timer(1000);
                m_timer.Elapsed += timer_Elapsed;
                m_timer.AutoReset = true;
                m_gameTimer.RequestNextTimerTick += game_RequestNextTimerTick;
            }
        }
예제 #6
0
        public bool Initialise(out List <string> errors)
        {
            Logging.Log.DebugFormat("{0} Initialising {1}", GameId, m_filename);

            IASL game;

            if (LoadData != null)
            {
                game = GameLauncher.GetGame(Convert.FromBase64String(LoadData), ApiGameData.ASLVersion, ApiGameData.SourceGameUrl);
            }
            else
            {
                game = GameLauncher.GetGame(m_filename, LibraryFolder);
            }

            m_controller = new PlayerHelper(game, this);
            m_controller.UseGameColours   = true;
            m_controller.UseGameFont      = true;
            m_controller.Game.LogError   += LogError;
            m_controller.Game.UpdateList += UpdateList;
            m_controller.Game.Finished   += GameFinished;

            IASLTimer gameTimer = game as IASLTimer;

            if (gameTimer != null)
            {
                gameTimer.RequestNextTimerTick += RequestNextTimerTick;
            }

            bool success = m_controller.Initialise(this, out errors);

            if (success)
            {
                Logging.Log.DebugFormat("{0} Initialised successfully", GameId);
            }
            else
            {
                Logging.Log.WarnFormat("{0} Failed to initialise game - errors found in file", GameId);
            }

            return(success);
        }