// 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); }
// 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); }