private void ParsePath()
    {
        string line = GetNextLine();

        string[] lineSplit = SplitLine(line);

        if (lineSplit.Length == 1)
        {
            ThrowInvalidLine("ParsePath()");
        }

        SimPathType pathType = new SimPathType();

        pathType.id = lineSplit[1];

        int splitOffset = 2;

        while (splitOffset < lineSplit.Length)
        {
            switch (lineSplit[splitOffset++])
            {
            case "color":
                pathType.color = ParseUint(lineSplit[splitOffset++]);
                break;

            default:
                ThrowInvalidLine("ParsePath()");
                break;
            }
        }

        definition.pathTypes.Add(pathType.id, pathType);
    }
Ejemplo n.º 2
0
    public SimPath AddPath(SimPathType pathType)
    {
        if (pathType == null)
        {
            throw new ArgumentNullException("pathType");
        }

        if (GetPath(pathType.id) != null)
        {
            throw new ArgumentException("Duplicated pathType", "pathType");
        }

        SimPath path = new SimPath();

        path.Init(pathType, this);

        paths.Add(path.id, path);

        boxListener.OnPathAdded(path);

        return(path);
    }
Ejemplo n.º 3
0
 public void Init(SimPathType pathType, SimBox box)
 {
     this.pathType = pathType;
     this.box      = box;
     this.id       = pathType.id;
 }