Example #1
0
        public static bool IsObjectANode(byte objectId, bool dotsCount = true, bool invisibleDotsCount = true, bool playableOnly = false)
        {
            // Check for Playable Nodes
            switch (objectId)
            {
            case (byte)OTerrainObjects.NodeStrict:
            case (byte)OTerrainObjects.NodeCasual:
            case (byte)OTerrainObjects.NodeWon:
                return(true);
            }

            if (playableOnly)
            {
                return(false);
            }

            if (dotsCount && NodeData.IsObjectADot(objectId, invisibleDotsCount))
            {
                return(true);
            }

            // Check for Non-Playable Nodes
            switch (objectId)
            {
            case (byte)OTerrainObjects.NodePoint:
            case (byte)OTerrainObjects.NodeMove:
            case (byte)OTerrainObjects.NodeWarp:
                return(true);
            }

            return(false);
        }
Example #2
0
        public static bool IsDirectionAllowed(byte objectId, DirCardinal dir)
        {
            // All Level Nodes can move in all directions.
            if (NodeData.IsObjectANode(objectId, false))
            {
                return(true);
            }

            // Dots may or may not have direction allowance:
            if (NodeData.IsObjectADot(objectId))
            {
                var dirsAllowed = NodeData.GetDotDirections(objectId);

                if (dir == DirCardinal.Up)
                {
                    return(dirsAllowed.up);
                }
                if (dir == DirCardinal.Down)
                {
                    return(dirsAllowed.down);
                }
                if (dir == DirCardinal.Left)
                {
                    return(dirsAllowed.left);
                }
                if (dir == DirCardinal.Right)
                {
                    return(dirsAllowed.right);
                }
            }

            return(false);
        }