InitializeDataValues() public static méthode

public static InitializeDataValues ( Data data, IList refs ) : void
data Data
refs IList
Résultat void
Exemple #1
0
        // Adds a new WarpDestData to the end of the group, returns the index
        public WarpDestData AddDestData()
        {
            WarpDestData newData = new WarpDestData(Project,
                                                    WarpDestData.WarpCommand,
                                                    null,
                                                    fileParser, new List <int> {
                -1
            });

            ValueReference.InitializeDataValues(newData, newData.GetValueReferences());

            newData.Transition = 1;

            newData.DestGroup = this;
            newData.DestIndex = warpDestDataList.Count;

            fileParser.InsertComponentAfter(warpDestDataList[warpDestDataList.Count - 1], newData);
            warpDestDataList.Add(newData);

            return(newData);
        }
Exemple #2
0
        public void InsertObject(int index, ObjectType type)
        {
            if (GetNumObjects() == 0 && !IsIsolated())
            {
                // If this map is sharing data with other maps (as when "blank"), need to make
                // a unique section for this map.

                parser.RemoveLabel(Identifier);

                parser.InsertParseableTextAfter(null, new String[] { "" }); // Newline
                parser.InsertComponentAfter(null, new Label(parser, Identifier));

                ObjectData endData = new ObjectData(Project,
                                                    ObjectCommands[(int)ObjectType.End],
                                                    null,
                                                    parser,
                                                    new string[] { "\t" }, // Tab at start of line
                                                    ObjectType.End);
                parser.InsertComponentAfter(null, endData);
                objectDataList[0] = endData;
            }

            ObjectData data = new ObjectData(Project,
                                             ObjectCommands[(int)type],
                                             null,
                                             parser,
                                             new string[] { "\t" }, // Tab at start of line
                                             type);

            ValueReference.InitializeDataValues(data, data.GetValueReferences());

            if (type >= ObjectType.Pointer && type <= ObjectType.AntiBossPointer)
            {
                data.SetValue(0, "objectData4000"); // Compileable default pointer
            }
            data.InsertIntoParserBefore(objectDataList[index]);
            objectDataList.Insert(index, data);
        }