Exemplo n.º 1
0
        public void load(IO binIo)
        {
            uint size = binIo.readUInt4();

            for (int i = 0; i < size; i++)
            {
                uint           id             = binIo.readUInt4();
                uint           numOfOverrides = binIo.readUInt4();
                OverrideStruct oStruct        = new OverrideStruct();
                if (numOfOverrides == 1)
                {
                    oStruct.Flag = FlagType.Single;
                    oStruct.Id   = binIo.readUInt4();
                }
                else
                {
                    oStruct.Flag = FlagType.Multi;
                    oStruct.List = new LinkedList <uint>();
                    for (int j = 0; j < numOfOverrides; j++)
                    {
                        oStruct.List.AddLast(binIo.readUInt4());
                    }
                }
                _overrides.Add(id, oStruct);
            }
        }
Exemplo n.º 2
0
        public void AddOverride(uint mid, uint omid)
        {
            if (!_factory.getExist(mid) || !_factory.getExist(omid))
            {
                throw new LimException("", "The end point of the override edge does not exist");
            }
            Nodes.Base.Base mnode = _factory.getRef(mid);
            Nodes.Base.Base onode = _factory.getRef(omid);

            if (Common.getIsMethod(mnode) && Common.getIsMethod(onode))
            {
                if (!_overrides.ContainsKey(mid))
                {
                    OverrideStruct oStruct = new OverrideStruct();
                    oStruct.Flag = FlagType.Single;
                    oStruct.Id   = omid;
                    _overrides.Add(mid, oStruct);
                }
                else
                {
                    if (_overrides[mid].Flag == FlagType.Single)
                    {
                        uint id = _overrides[mid].Id;
                        _overrides[mid].List.AddLast(id);
                        _overrides[mid].Flag = FlagType.Multi;
                    }
                }
            }
            else
            {
                throw new LimException("", "Invalid NodeKind (" + mnode.NodeKind + " " + onode.NodeKind + ")");
            }
        }