Exemplo n.º 1
0
        public RareAddonDeed(string name, string sourcefile)
        {
            Name       = name;
            SourceFile = sourcefile;
            RareAddonEntry test = RareSystem.GetRareAddonEntry(name, sourcefile);

            if (test == null)
            {
                // specification in file not found
                Delete();
            }
        }
Exemplo n.º 2
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);
            // must have all files parsed first
            if (RareSystem.ParsedFiles == null)
            {
                RareSystem.LoadRareConfigs();
            }

            int version = reader.ReadEncodedInt();

            SourceFile = reader.ReadString();
            RareAddonEntry rareAddonEntry = RareSystem.GetRareAddonEntry(Name, SourceFile);

            if (rareAddonEntry == null)
            {
                // specification in file not found
                Delete();
            }
        }
Exemplo n.º 3
0
        public RareAddon(string name, string sourcefile)
        {
            Name       = name;
            SourceFile = sourcefile;
            RareAddonEntry rareAddonEntry = RareSystem.GetRareAddonEntry(name, sourcefile);

            if (rareAddonEntry == null)
            {
                // specification in file not found
                Delete();
                return;
            }
            foreach (RareAddonComponentEntry component in rareAddonEntry.Components)
            {
                AddonComponent newAddonComponent = new AddonComponent(component.ItemID)
                {
                    Hue     = component.Hue,
                    Visible = component.Visible
                };
                AddComponent(newAddonComponent, component.X, component.Y, component.Z);
            }
            RaresFile.AddScriptAttachments(this, rareAddonEntry.ScriptFiles);
        }