Example #1
0
        public void Perf_CreateElements_Binary5()
        {
            var dm = MakeDatamodel();

            dm.Root = new Element(dm, "root");
            var inner_elem = new Element(dm, "inner_elem");
            var arr        = new ElementArray(20000);

            dm.Root["big_array"] = arr;

            foreach (int i in Enumerable.Range(0, 19999))
            {
                arr.Add(inner_elem);
            }

            SaveAndConvert(dm, "binary", 5);
            Cleanup();
        }
Example #2
0
 /// <summary>
 /// Adds a new element definition to the Block
 /// </summary>
 public void Add()
 {
     AddPreprocess(); elements.Add(kState.NewInstance(this) as T);
     OnPropertyChanged("Elements");
 }
 /// <summary>
 /// Adds a new element definition to the Block
 /// </summary>
 public void Add()
 {
     AddPreprocess(); elements.Add(kState.NewInstance(this) as T);
 }
Example #4
0
        public void Perf_CreateElements_Binary5()
        {
            var dm = MakeDatamodel();
            dm.Root = new Element(dm, "root");
            var inner_elem = new Element(dm, "inner_elem");
            var arr = new ElementArray(20000);
            dm.Root["big_array"] = arr;

            foreach (int i in Enumerable.Range(0, 19999))
                arr.Add(inner_elem);

            SaveAndConvert(dm, "binary", 5);
            Cleanup();
        }
Example #5
0
        private bool SetupForTeleporter()
        {
            object obj =
                ContentManager.Instance.SelectEntry(
                    new Link(LinkDestination.GameBINEntryName, "OBJECT"),
                    "OBJECT_GUILD_PEDESTAL_TELEPORT_01");

            if (obj != null)
            {
                ContentObject o = ContentManager.Instance.FindEntry(
                    LinkDestination.GameBINEntryName, obj);

                BINEntry entry = (BINEntry)o.Object;

                if (entry.Definition != "OBJECT")
                {
                    FormMain.Instance.ErrorMessage(
                        "Invalid object selected.");
                    return(false);
                }

                myCreatedThing = new FableMod.TNG.Thing("Object");

                myCreatedThing.Create(
                    FileDatabase.Instance.TNGDefinitions,
                    entry.Name);

                myCreatedThing.UID    = FableMod.TNG.UIDManager.Generate();
                myCreatedThing.Player = 4;
                myCreatedThing.get_Variables("ScriptData").Value =
                    "Teleport?";

                entry = null;
                o     = null;

                CTCBlock block = (CTCBlock)myCreatedThing.ApplyCTC(
                    FileDatabase.Instance.TNGDefinitions,
                    "CTCActionUseScriptedHook");

                block.get_Variables("Usable").Value                   = true;
                block.get_Variables("ForceConfirmation").Value        = true;
                block.get_Variables("TeleportToRegionEntrance").Value =
                    true;

                ElementArray arr = (ElementArray)
                                   myCreatedThing.Find("CreateTC");

                Variable var = (Variable)arr.Add();
                var.Value = "CTCActionUseScriptedHook";

                // Create the teleporter marker.

                FableMod.TNG.Thing marker = new FableMod.TNG.Thing("Marker");

                marker.Create(
                    FileDatabase.Instance.TNGDefinitions,
                    "MARKER_BASIC");

                marker.UID    = FableMod.TNG.UIDManager.Generate();
                marker.Player = 4;

                // Set the teleport connector.
                block.get_Variables("EntranceConnectedToUID").Value =
                    marker.UID;

                // We're creating a teleporter...
                myTeleporter = marker;

                return(true);
            }

            return(false);
        }