Example #1
0
        public GameModel()
        {
            PrepareDataLoader();
            m_gameWorld     = new GameWorld(this);
            m_referenceData = new GameReferenceData();
            m_gameConfig    = new GameConfig(this);
            m_tickUpdater   = new GameTickUpdater(this);

            m_smCharacterDetail = new ScreenModelCharacterDetail(this);
            m_smCredits         = new ScreenModelCredits(this);
            m_smPressYourLuck   = new ScreenModelPressYourLuck(this);
            m_smTitleMenu       = new ScreenModelTitleMenu(this);

            GameCamera.InitializeViewCamera(Camera);

            TimeWaveManager.InitializeGameModel(this);

            World.StatePrimary = GameStatePrimary.LoadingResources;
        }
        public static void Draw(GameModel model, Painter painter, Graphics g, Int32 totalClientWidth, Int32 totalClientHeight)
        {
            s_penWhite = new Pen(Color.White, (Single)(5 * model.Camera.CurrentScale));
            ScreenModelPressYourLuck screenModel = model.SMPressYourLuck;
            Position logPosBoundary = screenModel.LogPosSelectorBoundary;

            for (Int32 colIndex = 0; colIndex < 5; colIndex++)
            {
                for (Int32 rowIndex = 0; rowIndex < 5; rowIndex++)
                {
                    Position   logPos  = new Position(logPosBoundary.UpperLeftX + 25 + 50 * colIndex, logPosBoundary.UpperLeftY + 50 + 50 * rowIndex, 50, 50);
                    Position   dispPos = model.Camera.MapLogicalToDisplay(logPos, true);
                    SolidBrush sb      = GetSolidBrushForOutcome(screenModel.RatingGrid[colIndex, rowIndex]);
                    Drawing2D.DrawRect(g, sb, dispPos);
                }
            }

            Position logPosSelected = new Position(logPosBoundary.UpperLeftX + 25 + 50 * screenModel.SelectedX,
                                                   logPosBoundary.UpperLeftY + 50 + 50 * screenModel.SelectedY, 50, 50);

            Drawing2D.DrawRectBorder(g, s_penWhite, model.Camera.MapLogicalToDisplay(logPosSelected, true));
            s_penWhite.Dispose();
        }