예제 #1
0
        // Get an indexed child's Point value.
        public Point2I GetPoint(int index)
        {
            CommandParam p = GetParam(index);

            if (p.type == CommandParamType.Array && p.ChildCount == 2)
            {
                return(new Point2I(p.GetInt(0), p.GetInt(1)));
            }
            return(Point2I.Zero);
        }
예제 #2
0
        // Get an indexed child's Point value, with a default if the child doesn't exist.
        public Point2I GetPoint(int index, Point2I defaultValue)
        {
            if (index >= count)
            {
                return(defaultValue);
            }
            CommandParam p = GetParam(index);

            if (p.type == CommandParamType.Array && p.ChildCount == 2)
            {
                return(new Point2I(p.GetInt(0), p.GetInt(1)));
            }
            return(Point2I.Zero);
        }