示例#1
0
 private void Awake()
 {
     setReadyCoroutine  = WaitAndSetReady(0.2f);
     gemManagerInstance = new GemManager(rowCount, columnCount);
     gemManagerInstance.OnGemCreated         += OnGemCreated;
     gemManagerInstance.OnGemMatch           += OnGemMatch;
     gemManagerInstance.OnReadyStateChanged  += OnReadyStateChanged;
     gemManagerInstance.OnPossibleMoveCreate += OnPossibleMoveCreate;
     gemManagerInstance.Init();
 }
示例#2
0
        public MainWindow()
        {
            InitializeComponent();

            DataContext = this;

            #region ウィンドウスタイル設定
            //// タイトル
            this.Title = "Title";//Properties.Resources.Str_Title;

            //// メニュー
            this.ExitMenuItem.Header  = "Exit";  //Properties.Resources.Command_Exit;
            this.PauseMenuItem.Header = "Pause"; //Properties.Resources.Command_Pause;

            //// キー処理
            this.KeyUp += new KeyEventHandler(MainWindow_KeyUp);

            //// アイコン
            //System.IO.MemoryStream memStream = new System.IO.MemoryStream();
            //(Properties.Resources.Ico_App as System.Drawing.Icon).Save(memStream);
            //this.Icon = BitmapFrame.Create(memStream);

            //// 透明化
            //this.AllowsTransparency = true;
            //this.Background = Brushes.Transparent;
            //this.WindowStyle = System.Windows.WindowStyle.None;

            //// サイズ設定
            //this.WindowState = System.Windows.WindowState.Maximized;
            #endregion

            // Load後の処理
            this.Loaded += (s, e) =>
            {
                mIsAvailable = true;
            };

            // 閉じた後の処理
            this.Closing += (s, e) =>
            {
                mIsClosed    = true;
                mIsAvailable = false;
                //if (_notifyIconManager != null) _notifyIconManager.Dispose();
            };

            //---------------------------------------------MATCH3CORE---------------------------------------------
            Logger.Instance.OnDebugMessage   += OnDebugMessage;
            Logger.Instance.OnWarningMessage += OnWarningMessage;
            Logger.Instance.OnErrorMessage   += OnErrorMessage;

            TileType[][] tiles = new TileType[columnCount][];
            for (int i = 0; i < tiles.Length; i++)
            {
                tiles[i] = new TileType[rowCount];
                for (int j = 0; j < tiles[i].Length; j++)
                {
                    bool isempty = false;
                    foreach (int[] index in emptyTiles)
                    {
                        if (index[0] == i && index[1] == j)
                        {
                            isempty = true;
                        }
                    }
                    tiles[i][j] = isempty ? TileType.None : TileType.Regular;
                }
            }

            manager = new GemManager(rowCount, columnCount /*, tiles*/);
            manager.OnGemCreated         += OnGemCreated;
            manager.OnPossibleMoveCreate += OnPossibleMoveCreate;
            manager.Init();
            //---------------------------------------------MATCH3CORE---------------------------------------------
        }