Exemple #1
0
 /// <summary>
 /// 指定した位置に牌を配置します。
 /// </summary>
 /// <param name="position">配置する位置</param>
 /// <param name="tile">牌</param>
 public void SetWallTile(WallPosition position, uint tile)
 {
     Debug.Assert(position.Wind != Wind.Index.Undefined, "風が未定義です。");
     Debug.Assert(position.Rank != Wall.Rank.Undefined, "段が未定義です。");
     Debug.Assert(position.Index >= 0 && position.Index < Wall.Length, "インデックスが不正です。");
     this.Walls[position.Wind.ToInt()][position.Rank.ToInt()][position.Index] = tile;
 }
Exemple #2
0
 /// <summary>
 /// 指定した位置の壁牌を取得します。
 /// </summary>
 /// <returns>指定した位置の壁牌</returns>
 /// <param name="position">壁牌の位置</param>
 public uint GetWallTile(WallPosition position)
 {
     Debug.Assert(position.Wind != Wind.Index.Undefined, "風が未定義です。");
     Debug.Assert(position.Rank != Wall.Rank.Undefined, "段が未定義です。");
     Debug.Assert(position.Index >= 0 && position.Index < Wall.Length, "インデックスが不正です。");
     return(this.Walls[position.Wind.ToInt()][position.Rank.ToInt()][position.Index]);
 }
Exemple #3
0
        /// <summary>
        /// 位置の種別を取得します。
        /// </summary>
        /// <returns>位置の種別</returns>
        /// <param name="openGatePosition">開門位置</param>
        public Type GetPositionType(WallPosition openGatePosition)
        {
            Debug.Assert(openGatePosition != null && openGatePosition.Wind != Models.Wind.Index.Undefined && openGatePosition.Index > 0, $"開門位置が不正です。{openGatePosition}");
            var type = Type.Default;

            if (this.Wind == openGatePosition.Wind.Prev() && this.Index == 0 && this.Rank == Wall.Rank.Lower)
            {
                type = Type.SeaFloor;
            }
            if (this.Wind == openGatePosition.Wind && this.Index > openGatePosition.Index)
            {
                type = Type.Dead;
            }
            return(type);
        }