コード例 #1
0
        /// <summary>
        /// Callback for the event fired when an arrow is added to the game Board.
        /// </summary>
        /// <param name="player">Player who owns the added Arrow</param>
        /// <param name="arrow">Arrow added to the Board</param>
        /// <param name="eventArgs">Event args (unused)</param>
        private void Arrow_AddedToBoardCallback(Player player, Arrow arrow, EventArgs eventArgs)
        {
            // CreateOrUpdateArrowImage will return null if it updated an existing arrow image
            Image newArrowImage = this.uiBuilder.CreateOrUpdateArrowImage(player, arrow);

            if (newArrowImage != null)
            {
                UiBuilder.AddItemToGrid(this.DynamicArrowPanel, newArrowImage);
            }
        }
コード例 #2
0
 /// <summary>
 /// Callback for the event fired when a wall is added to the game Board.
 /// </summary>
 /// <param name="cellCol">Column for one of the cells the wall borders</param>
 /// <param name="cellRow">Row for one of the cells the wall borders</param>
 /// <param name="wallPosition">Position the wall is relative to the given cell</param>
 /// <param name="eventArgs">Event args (unused)</param>
 private void Wall_AddedToBoardCallback(int cellCol, int cellRow, WallPositionFlags wallPosition, EventArgs eventArgs)
 {
     if (wallPosition == WallPositionFlags.Left || wallPosition == WallPositionFlags.Right)
     {
         UiBuilder.AddItemToGrid(this.DynamicVertWallPanel,
                                 this.uiBuilder.CreateVerticalWallImage(cellCol, cellRow, wallPosition));
     }
     else if (wallPosition == WallPositionFlags.Up || wallPosition == WallPositionFlags.Down)
     {
         UiBuilder.AddItemToGrid(this.DynamicHorizWallPanel,
                                 this.uiBuilder.CreateHorizontalWallImage(cellCol, cellRow, wallPosition));
     }
 }
コード例 #3
0
        /// <summary>
        /// Callback for the event fired when a hole is added to the game Board.
        /// </summary>
        /// <param name="boardObject">BoardObject (hole) added to the Board</param>
        /// <param name="eventArgs">Event args (unused)</param>
        private void Hole_AddedToBoardCallback(BoardObject boardObject, EventArgs eventArgs)
        {
            Hole holeAdded = boardObject as Hole;

            UiBuilder.AddItemToGrid(this.DynamicHolePanel, this.uiBuilder.CreateHoleImage(holeAdded));
        }
コード例 #4
0
        /// <summary>
        /// Callback for the event fired when a base is added to the game Board.
        /// </summary>
        /// <param name="boardObject">BoardObject (base) added to the Board</param>
        /// <param name="eventArgs">Event args (unused)</param>
        private void Base_AddedToBoardCallback(BoardObject boardObject, EventArgs eventArgs)
        {
            Base baseAdded = boardObject as Base;

            UiBuilder.AddItemToGrid(this.DynamicBasePanel, this.uiBuilder.CreateBaseImage(baseAdded));
        }