IsRevealedWorld() public method

Returns whether a given world coordinate is relealed.
public IsRevealedWorld ( float worldX, float worldY ) : bool
worldX float The world x coordinate.
worldY float The world y coordinate.
return bool
Beispiel #1
0
        /// <summary>
        /// Returns whether a given world position is in view of a given viewer.
        /// </summary>
        /// <param name="viewer">The viewer to check visibility for.</param>
        /// <param name="targetPosition">The world coordinates.</param>
        /// <returns>Whether in view.</returns>
        public bool IsPositionInDirectView(IViewer viewer, ref Vector3 targetPosition)
        {
            if (mViewers.ContainsKey(viewer))
            {
                VisibilityGrid grid = mViewers[viewer].LocalVisibilityGrid;

                return(grid.IsRevealedWorld(targetPosition.X, targetPosition.Y));
            }
#if DEBUG
            else
            {
                throw new InvalidOperationException("Viewer does not exist in Visbility grid");
            }
#else
            return(false);
#endif
        }