Exemple #1
0
        /// <summary>
        /// Checks if a position is occupied. Returns true if it is. False if it is NOT
        /// </summary>
        /// <param name="position"></param>
        /// <returns></returns>
        internal bool checkPosition(PositionClass position)
        {
            //If the object at the specified position is not null, return true
            if (positions[position] != null)
            {
                return(true);
            }

            return(false);
        }
Exemple #2
0
        /// <summary>
        /// Returns the object occupying a position if one exists, otherwise returns null
        /// </summary>
        /// <param name="position"></param>
        /// <returns></returns>
        internal Object getObjectAtPosition(PositionClass position)
        {
            //If there is an object here, return it
            if (positions[position] != null)
            {
                return(positions[position]);
            }

            //Print the given position to the console if debugging and return null
            DebugLog.Log(DebugLog.NoObjectAtPositionLog, position.getXPosition.ToString() + position.getYPosition.ToString());
            return(null);
        }