Beispiel #1
0
        public void AddEntry(string path, RSAREntryNode node)
        {
            RSAREntryState       state = new RSAREntryState();
            RSARStringEntryState str   = new RSARStringEntryState();

            state._node = node;
            if (node._name != "<null>")
            {
                str._name = path;
            }
            else
            {
                str._name = null;
            }

            if (String.IsNullOrEmpty(str._name))
            {
                state._stringId = -1;
            }

            int type = -1;
            List <RSAREntryState> group;

            if (node is RSARSoundNode)
            {
                group = _sounds;
                type  = 3;
            }
            else if (node is RSARGroupNode)
            {
                group = _groups;
                type  = 1;
            }
            else if (node is RSARPlayerInfoNode)
            {
                group = _playerInfo;
                type  = 0;
            }
            else
            {
                group = _banks;
                type  = 2;
            }

            str._type  = type;
            str._index = node.InfoIndex;

            _tempStrings.Add(str);

            state._index = group.Count;
            group.Add(state);

            state._node._rebuildIndex = state._index;
        }
Beispiel #2
0
        public void AddEntry(string path, ResourceNode node)
        {
            RSAREntryState state = new RSAREntryState();

            state._node = node;

            if (string.IsNullOrEmpty(path))
            {
                state._stringId = -1;
            }
            else
            {
                int id = _strings.IndexOf(path);
                if (id > 0)
                {
                    state._stringId = id;
                }
                else
                {
                    state._stringId = _strings.Count;
                    _strings.Add(path);
                    _stringLength += path.Length + 1;
                }
            }

            List <RSAREntryState> group;

            if (node is RSARSoundNode)
            {
                group = _sounds;
            }
            else if (node is RSARGroupNode)
            {
                group = _groups;
            }
            else if (node is RSARTypeNode)
            {
                group = _types;
            }
            else
            {
                group = _banks;
            }

            state._index = group.Count;
            group.Add(state);

            _count++;
        }
Beispiel #3
0
 public static int Compare(RSAREntryState n1, RSAREntryState n2)
 {
     return(n2._node.InfoIndex <n1._node.InfoIndex ? 1 : n2._node.InfoIndex> n1._node.InfoIndex ? -1 : 0);
     //return n2._stringId < n1._stringId ? 1 : n2._stringId > n1._stringId ? -1 : 0;
 }