Exemple #1
0
        public CmpAnimal(CmpGame parent, CmpButton control, AnimalType eType, AnimalAge eAge)
        {
            m_Parent  = parent;
            m_Control = control;

            switch (eType)
            {
            case AnimalType.AT_BEAR:
                m_Animal = new Bear(eAge);
                break;

            case AnimalType.AT_ELK:
                m_Animal = new Elk(eAge);
                break;

            case AnimalType.AT_FOX:
                m_Animal = new Fox(eAge);
                break;

            case AnimalType.AT_HARE:
                m_Animal = new Hare(eAge);
                break;

            case AnimalType.AT_HEDGEHOG:
                m_Animal = new Hedgehog(eAge);
                break;

            case AnimalType.AT_LYNX:
                m_Animal = new Lynx(eAge);
                break;

            case AnimalType.AT_SQUIRREL:
                m_Animal = new Squirrel(eAge);
                break;

            case AnimalType.AT_WOLF:
                m_Animal = new Wolf(eAge);
                break;
            }

            m_Control.SetCallback(this);
            m_Control.SetImage(m_Animal.GetImagePath());
            Uncheck();
            Enable();
        }
Exemple #2
0
        public CmpPage(GameModeController gmCtl)
        {
            m_gmCtl = gmCtl;

            InitializeComponent();

            backgroundImage.Source = ResourceController.GetResourceBitmap("/Image/CmpGM/bg.jpg");
            titleImage.Source      = ResourceController.GetResourceBitmap("/Image/CmpGM/cmp_gmode_title.png");

            m_Game = new CmpGame(this, new CmpButton[]
            {
                cmpButton_0_0, cmpButton_0_1, cmpButton_0_2,
                cmpButton_1_0, cmpButton_1_1, cmpButton_1_2
            });

            m_bPageLoaded = m_bNeedStart = false;

            this.Loaded      += OnPageLoad;
            this.SizeChanged += OnSizeChanged;
        }