コード例 #1
0
        public MoveResult TryMoveTo(Tile pos)
        {
            // empty sea?
            if (pos.IsWater && pos.Actors.Count == 0)
            {
                return(MoveResult.Success());
            }
            // port?
            if (pos.IsDestroyerPort)
            {
                return(MoveResult.InPort());
            }
            // aground?
            if (pos.IsLand)
            {
                var result = new MoveResult {
                    Result = MoveResults.Aground,
                }
            }
            // for each actor on the tile

            // merchant ship?
            //  collision
            // submarine?
            // surfaced?
            //   collision
            // periscope depth?
            //   collision
            // submerged?
            //   collision
            // torpedo?
            // mine?
            return(MoveResult.Success());
        }
コード例 #2
0
ファイル: MoveAnywherePhysics.cs プロジェクト: shasta9/seawar
 public MoveResult TryMoveTo(Tile pos)
 {
     return(MoveResult.Success());
 }