Exemplo n.º 1
0
        private bool getComboBoxCharakter()
        {
            DescID cid = new DescID(new DescLevel(SKELETT_TYPE, C4dApi.DTYPE_LONG, 0));

            //Erstellt das Label vor die Combobox
            BaseContainer bcComboName = C4dApi.GetCustomDataTypeDefault(C4dApi.DTYPE_LONG);

            bcComboName.SetString(C4dApi.DESC_NAME, "Skelett wählen");

            //Erstellen der ComboBox mit Werten
            BaseContainer bcComboValues = C4dApi.GetCustomDataTypeDefault(C4dApi.DTYPE_NONE);

            bcComboValues.SetString(0, "Skelett");
            bcComboValues.SetString(1, "Männlich");
            bcComboValues.SetString(2, "Weiblich");
            bcComboValues.SetString(3, "4 Beiner");

            //Führt beide Container zusammen
            bcComboName.SetContainer(C4dApi.DESC_CYCLE, bcComboValues);

            //Erstellt die Combobox in dem Reiter Object, wegen "ID_OBJECTPROPERTIES"
            if (!descparams.Desc.SetParameter(cid, bcComboName, new DescID(new DescLevel(C4dApi.ID_OBJECTPROPERTIES))))
            {
                return(true);
            }

            return(false);
        }
Exemplo n.º 2
0
        private bool getTail()
        {
            DescID cid = new DescID(new DescLevel(SKELETT_SCHWANZ, C4dApi.DTYPE_LONG, 0));

            BaseContainer bcSchwanz = C4dApi.GetCustomDataTypeDefault(C4dApi.DTYPE_LONG);

            bcSchwanz.SetString(C4dApi.DESC_NAME, "Schwanz Knochen");
            //Definiert den minimalen Wert
            bcSchwanz.SetInt64(C4dApi.DESC_MIN, 0);
            //Definiert den maximalen Wert
            bcSchwanz.SetInt64(C4dApi.DESC_MAX, 5);
            if (Schwanz == true)
            {
                bcSchwanz.SetBool(C4dApi.DESC_HIDE, false);
                Schwanz = false;
            }
            else
            {
                bcSchwanz.SetBool(C4dApi.DESC_HIDE, true);
            }


            if (!descparams.Desc.SetParameter(cid, bcSchwanz, new DescID(new DescLevel(C4dApi.ID_OBJECTPROPERTIES))))
            {
                return(true);
            }

            return(false);
        }
Exemplo n.º 3
0
 public GetPlexLibraryByIdQueryTests(ITestOutputHelper output)
 {
     BaseDependanciesTest.SetupLogging(output);
     Container  = new BaseContainer();
     _dbContext = Container.PlexRipperDbContext;
     _mediator  = Container.Mediator;
 }
Exemplo n.º 4
0
        private bool getNeckLink()
        {
            DescID cid = new DescID(new DescLevel(SKELETT_HALSWIRBEL, C4dApi.DTYPE_LONG, 0));

            BaseContainer bcHalsWirbel = C4dApi.GetCustomDataTypeDefault(C4dApi.DTYPE_LONG);

            bcHalsWirbel.SetString(C4dApi.DESC_NAME, "Halswirbel Knochen");
            //Definiert den minimalen Wert
            bcHalsWirbel.SetInt64(C4dApi.DESC_MIN, 0);
            //Definiert den maximalen Wert
            bcHalsWirbel.SetInt64(C4dApi.DESC_MAX, 15);
            if (Schwanz == true)
            {
                bcHalsWirbel.SetBool(C4dApi.DESC_HIDE, false);
                //Schwanz = false;
            }
            else
            {
                bcHalsWirbel.SetBool(C4dApi.DESC_HIDE, true);
            }


            if (!descparams.Desc.SetParameter(cid, bcHalsWirbel, new DescID(new DescLevel(C4dApi.ID_OBJECTPROPERTIES))))
            {
                return(true);
            }

            return(false);
        }
Exemplo n.º 5
0
 public BaseContainer(BaseContainer n) : this(C4dApiPINVOKE.new_BaseContainer__SWIG_2(BaseContainer.getCPtr(n)), true)
 {
     if (C4dApiPINVOKE.SWIGPendingException.Pending)
     {
         throw C4dApiPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Exemplo n.º 6
0
    /// <summary>
    ///     Attempts to move a held item from a hand into a container that is not another hand, without dropping it on the floor in-between.
    /// </summary>
    public bool TryDropIntoContainer(EntityUid uid, EntityUid entity, BaseContainer targetContainer, bool checkActionBlocker = true, SharedHandsComponent?handsComp = null)
    {
        if (!Resolve(uid, ref handsComp))
        {
            return(false);
        }

        if (!IsHolding(uid, entity, out var hand, handsComp))
        {
            return(false);
        }

        if (!CanDropHeld(uid, hand, checkActionBlocker))
        {
            return(false);
        }

        if (!targetContainer.CanInsert(entity, EntityManager))
        {
            return(false);
        }

        DoDrop(uid, hand, false, handsComp);
        targetContainer.Insert(entity);
        return(true);
    }
Exemplo n.º 7
0
        public void Generate(IEntity e)
        {
            BaseContainer cont              = null;
            LootStage     stage             = LootStage.Death;
            int           luckChance        = 0;
            bool          hasBeenStolenFrom = false;
            Mobile        from              = e as Mobile;

            if (e is BaseCreature bc)
            {
                cont              = bc.Backpack as BaseContainer;
                stage             = bc.LootStage;
                luckChance        = bc.KillersLuck;
                hasBeenStolenFrom = bc.StealPackGenerated;
            }
            else
            {
                cont = e as BaseContainer;
            }

            if (cont != null)
            {
                Generate(from, cont, stage, luckChance, hasBeenStolenFrom);
            }
        }
Exemplo n.º 8
0
        public BaseContainer GetContainer()
        {
            global::System.IntPtr cPtr = C4dApiPINVOKE.GeData_GetContainer(swigCPtr);
            BaseContainer         ret  = (cPtr == global::System.IntPtr.Zero) ? null : new BaseContainer(cPtr, false);

            return(ret);
        }
Exemplo n.º 9
0
        private bool getFingers(BaseContainer dataKoerper)
        {
            //Erstellt ein weiteres Feld für die Finger
            DescID        cid      = new DescID(new DescLevel(SKELETT_FINGER, C4dApi.DTYPE_LONG, 0));
            BaseContainer bcFinger = C4dApi.GetCustomDataTypeDefault(C4dApi.DTYPE_LONG);

            bcFinger.SetString(C4dApi.DESC_NAME, "Finger");
            //Definiert den minimalen Wert
            bcFinger.SetInt64(C4dApi.DESC_MIN, 0);
            //Definiert den maximalen Wert
            bcFinger.SetInt64(C4dApi.DESC_MAX, 5);
            if (Hand == true)
            {
                if (dataKoerper.GetInt64(SKELETT_HAND) > 0)
                {
                    bcFinger.SetBool(C4dApi.DESC_HIDE, false);
                }
                else
                {
                    bcFinger.SetBool(C4dApi.DESC_HIDE, true);
                }
            }
            else
            {
                bcFinger.SetBool(C4dApi.DESC_HIDE, true);
            }
            if (!descparams.Desc.SetParameter(cid, bcFinger, new DescID(new DescLevel(C4dApi.ID_OBJECTPROPERTIES))))
            {
                return(true);
            }

            return(false);
        }
Exemplo n.º 10
0
        public override void AddContents(BaseContainer cont, Mobile creature, out int contentValue)
        {
            base.AddContents(cont, creature, out contentValue);

            if (m_RuneChance > Utility.RandomDouble())
            {
                cont.DropItem(new RecallRune());
            }

            int scrollcount = Utility.RandomMinMax(MinAmount / 25, MaxAmount / 8);

            for (int i = 0; i < scrollcount; i++)
            {
                if ((m_RuneChance / 3.0) > Utility.RandomDouble())
                {
                    Item item = null;
                    switch (Utility.Random(5))
                    {
                    default:
                    case 0:
                    case 1:
                    case 2: item = new RecallScroll(); break;

                    case 3: item = new MarkScroll(); break;

                    case 4: item = new GateTravelScroll(); break;
                    }

                    cont.DropItem(item);
                }
            }
        }
Exemplo n.º 11
0
 public CreateUpdateOrDeletePlexMoviesCommandTests(ITestOutputHelper output)
 {
     BaseDependanciesTest.SetupLogging(output);
     Container  = new BaseContainer();
     _dbContext = Container.PlexRipperDbContext;
     _mediator  = Container.Mediator;
 }
Exemplo n.º 12
0
        public BaseContainer GetOpContainerInstance()
        {
            global::System.IntPtr cPtr = C4dApiPINVOKE.GvNode_GetOpContainerInstance(swigCPtr);
            BaseContainer         ret  = (cPtr == global::System.IntPtr.Zero) ? null : new BaseContainer(cPtr, false);

            return(ret);
        }
Exemplo n.º 13
0
        public override bool GetDDescription(GeListNode node, DDescriptionParams descparams)
        {
            if (!descparams.Desc.LoadDescription("tbase"))
            {
                return(false);
            }

            VisitProps(delegate(int itemID, string itemName, PropertyInfo pi)
            {
                DescID cid       = new DescID(new DescLevel(itemID, C4dApi.DTYPE_LONG, 0));
                BaseContainer bc = null;
                if (pi.PropertyType == typeof(int))
                {
                    bc = C4dApi.GetCustomDataTypeDefault(C4dApi.DTYPE_LONG);
                }
                else if (pi.PropertyType == typeof(string))
                {
                    bc = C4dApi.GetCustomDataTypeDefault(C4dApi.DTYPE_STRING);
                }
                bc.SetString(C4dApi.DESC_NAME, itemName);
                descparams.Desc.SetParameter(cid, bc, new DescID(new DescLevel(C4dApi.ID_TAGPROPERTIES)));
            });

            descparams.Flags |= DESCFLAGS_DESC.DESCFLAGS_DESC_LOADED;

            return(true); // base.GetDDescription(node, descparams);
        }
        public override void AddContents(BaseContainer cont, Mobile creature, out int contentValue)
        {
            base.AddContents(cont, creature, out contentValue);

            if (m_BookChance > Utility.RandomDouble())
            {
                BaseSpellbookLootSet spellbookloot = MagicSpellbookLootSets.LootSet(m_SpellbookGrade);

                if (spellbookloot != null)                   //sanity check
                {
                    Tuple <Item[], int> spelltuple = spellbookloot.GenerateLootItem(creature);
                    if (spelltuple.Item1 != null)                       // another sanity check
                    {
                        for (int i = 0; i < spelltuple.Item1.Length; i++)
                        {
                            if (spelltuple.Item1[i] != null)                               // more sanity checks
                            {
                                cont.DropItem(spelltuple.Item1[i]);
                            }
                        }
                    }

                    contentValue += spelltuple.Item2;
                }
            }
        }
Exemplo n.º 15
0
        public void Load()
        {
            if (!File.Exists(SaveFileName))
            {
                Data = new BaseContainer();
                Save();
                Loger.Log("Server Create Data");
            }
            else
            {
                using (var fs = File.OpenRead(SaveFileName))
                {
                    var bf = new BinaryFormatter();
                    Data = (BaseContainer)bf.Deserialize(fs);
                    Loger.Log("Server Load Data");
                    Loger.Log("Server Users " + Data.PlayersAll.Count.ToString() + ": "
                              + Data.PlayersAll.Select(p => p.Public.Login).Aggregate((string)null, (r, i) => (r == null ? "" : r + ", ") + i)
                              );
                    PlayerServer.PublicPosts = Data.PlayersAll[0].PublicChat.Posts;

                    /*
                     * try ////////////////////////////////
                     * {
                     *  Loger.Log("Server test " + Data.PlayersAll[1].Chats[0].Posts.Count + "=" + Data.PlayersAll[Data.PlayersAll.Count - 1].Chats[0].Posts.Count);
                     *  Data.PlayersAll[1].Chats[0].Posts.Add(new ChatPost());
                     *  Loger.Log("Server test " + Data.PlayersAll[1].Chats[0].Posts.Count + "=" + Data.PlayersAll[Data.PlayersAll.Count - 1].Chats[0].Posts.Count);
                     * }
                     * catch { }
                     */
                }
            }
            ChangeData = false;
        }
Exemplo n.º 16
0
        public bool updateContainer(BaseContainer container)
        {
            _repo.Layouts.Update(container.Layout);
            var res = _repo.SaveChanges();

            return(res);
        }
Exemplo n.º 17
0
        public void Send <TClass>(BaseContainer <TClass> message, BaseAgenda agenda)
        {
            Container messageRequest = message.GetContainer();

            switch (agenda.Type)
            {
            case ChannelType.General:
            {
                foreach (KeyValuePair <Guid, WsConnection> connection in _connections.Where(author => author.Value.Login != message.Author))
                {
                    connection.Value.Send(messageRequest);
                }

                break;
            }

            case ChannelType.Private:
            {
                if (_connections.Values.Count == 0)
                {
                    return;
                }

                _connections.Values.FirstOrDefault(item => item.Login == ((PrivateAgenda)agenda).Target)?.Send(messageRequest);
                break;
            }
            }
        }
Exemplo n.º 18
0
        protected void Application_Start()
        {
            var container = new Container();

            // Simple Injector for MVC
            container.Options.DefaultScopedLifestyle = new WebRequestLifestyle();
            container.RegisterMvcControllers(Assembly.GetExecutingAssembly());
            container.RegisterMvcIntegratedFilterProvider();

            // Simple Injector - other services
            var baseContainer = new BaseContainer(container: container);

            var resolver = new SimpleInjectorDependencyResolver(baseContainer.Container);

            DependencyResolver.SetResolver(resolver);

            // Very Important
            MyServiceLocator.SetIoCContainer(baseContainer.Container);
            MyMvcServiceLocator.SetIoCContainer(resolver);

            // Initialize MVC settings
            AppStartInitializer.Initialize();

            NHSessionManager.AddEntityAssemblies(new[] { "MultiTenancyFramework.Mvc" });
        }
Exemplo n.º 19
0
        public BaseContainer GetData(BaseDocument doc, BaseList2D pObject)
        {
            global::System.IntPtr cPtr = C4dApiPINVOKE.InExcludeData_GetData__SWIG_1(swigCPtr, BaseDocument.getCPtr(doc), BaseList2D.getCPtr(pObject));
            BaseContainer         ret  = (cPtr == global::System.IntPtr.Zero) ? null : new BaseContainer(cPtr, false);

            return(ret);
        }
Exemplo n.º 20
0
        public async Task <bool> SaveContainer(BaseContainer container)
        {
            _repo.Containers.Create(container);
            var res = await _repo.SaveAsync();

            return(res);
        }
Exemplo n.º 21
0
        public BaseContainer GetData(int lIndex)
        {
            global::System.IntPtr cPtr = C4dApiPINVOKE.InExcludeData_GetData__SWIG_0(swigCPtr, lIndex);
            BaseContainer         ret  = (cPtr == global::System.IntPtr.Zero) ? null : new BaseContainer(cPtr, false);

            return(ret);
        }
Exemplo n.º 22
0
        public void Init()
        {
            var container = new Container();

            var baseContainer = new BaseContainer(null, container);

            // Very Important
            MyServiceLocator.SetIoCContainer(baseContainer.Container);

            client = new SmtpClient
            {
                EnableSsl             = true,
                UseDefaultCredentials = false,
                DeliveryMethod        = SmtpDeliveryMethod.Network,

                //Gmail
                //Host = "smtp.gmail.com",
                //Port = 587,
                //Credentials = new NetworkCredential("*****@*****.**", "october2014"),

                //GoDaddysmtpout
                Host        = "relay-hosting.secureserver.net",
                Port        = 25,
                Credentials = new NetworkCredential("*****@*****.**", "Sw882@1"),
            };

            //Gmail
            //sender = "*****@*****.**";

            //GoDaddy
            sender = "*****@*****.**";
        }
Exemplo n.º 23
0
        private static void MoveNextBenchMut(BaseContainer <int> bcMut, int count, int mult)
        {
            // warmup
            for (int _ = 0; _ < 1; _++)
            {
                var cMut = new BlockCursor <int, object, BaseContainer <int> >(bcMut);

                for (int i = 0; i < count; i++)
                {
                    cMut.MoveNext();
                }
            }

            using (Benchmark.Run("Mut", count * mult))
            {
                for (int _ = 0; _ < mult; _++)
                {
                    var cMut = new BlockCursor <int, object, BaseContainer <int> >(bcMut);

                    for (int i = 0; i < count; i++)
                    {
                        cMut.MoveNext();
                    }
                }
            }
        }
Exemplo n.º 24
0
        public static BaseContainer GetDataInstance(BaseTag op)
        {
            global::System.IntPtr cPtr = C4dApiPINVOKE.TagDataM_GetDataInstance__SWIG_0(BaseTag.getCPtr(op));
            BaseContainer         ret  = (cPtr == global::System.IntPtr.Zero) ? null : new BaseContainer(cPtr, false);

            return(ret);
        }
Exemplo n.º 25
0
        public BaseContainer GetContainerInstance(int id)
        {
            global::System.IntPtr cPtr = C4dApiPINVOKE.BaseContainer_GetContainerInstance__SWIG_0(swigCPtr, id);
            BaseContainer         ret  = (cPtr == global::System.IntPtr.Zero) ? null : new BaseContainer(cPtr, false);

            return(ret);
        }
Exemplo n.º 26
0
        public static BaseContainer GetDataInstance(GeListNode node)
        {
            global::System.IntPtr cPtr = C4dApiPINVOKE.TagDataM_GetDataInstance__SWIG_1(GeListNode.getCPtr(node));
            BaseContainer         ret  = (cPtr == global::System.IntPtr.Zero) ? null : new BaseContainer(cPtr, false);

            return(ret);
        }
Exemplo n.º 27
0
        private void vsComboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            int           ix        = vsComboBox1.SelectedIndex;
            BaseContainer container = (BaseContainer)vsComboBox1.Items[ix];

            this.SelectedID = container.ID;
        }
Exemplo n.º 28
0
    private async Task HandleMouseClick(BaseContainer container, Server server, Player player, int slot)
    {
        if (!ClickedItem.IsAir())
        {
            var @event = await server.Events.InvokeContainerClickAsync(new ContainerClickEventArgs(player, container, ClickedItem)
            {
                Slot = slot
            });

            if (@event.Cancel)
            {
                return;
            }

            player.LastClickedItem = ClickedItem;

            container.RemoveItem(slot);
        }
        else
        {
            if (Button == 0)
            {
                server.Logger.LogDebug("Placed: {} in container: {}", player.LastClickedItem?.Type, container.Title?.Text);
                container.SetItem(slot, player.LastClickedItem);

                player.LastClickedItem = ClickedItem;
            }
            else
            {
                container.SetItem(slot, player.LastClickedItem);

                player.LastClickedItem = ClickedItem;
            }
        }
    }
Exemplo n.º 29
0
        public BaseContainer GetClone(COPYFLAGS flags, AliasTrans trans)
        {
            global::System.IntPtr cPtr = C4dApiPINVOKE.BaseContainer_GetClone(swigCPtr, (int)flags, AliasTrans.getCPtr(trans));
            BaseContainer         ret  = (cPtr == global::System.IntPtr.Zero) ? null : new BaseContainer(cPtr, false);

            return(ret);
        }
Exemplo n.º 30
0
    public void SortContainer(BaseContainer container)
    {
        if (container as DialogueContainer != null)
        {
            StartCoroutine(ShowText((DialogueContainer)container));
        }

        else if (container as ChoiceContainer != null)
        {
            StartCoroutine(ShowChoice((ChoiceContainer)container));
        }

        else if (container as SplitDialogueContainer != null)
        {
            SplitDialogueContainer c = (SplitDialogueContainer)container;

            switch (choiceManager.CheckChoice(c.choiceNumber))
            {
            default:
            case 1:
                StartCoroutine(ShowText(c.result1));
                break;

            case 2:
                StartCoroutine(ShowText(c.result2));
                break;
            }
        }
    }
Exemplo n.º 31
0
        public void Indexers_ReturnCorrectCell(int x, int y, int skip)
        {
            _container = new FakeBaseContainer(3, 3);
            var point = new Point(x, y);
            var expected = _container.Skip(skip).Take(1).Single();

            Assert.That(_container[x, y], Is.SameAs(expected),
                "XYIndexer not working");
            Assert.That(_container[point], Is.SameAs(expected),
                "PointIndexer not working");
        }
Exemplo n.º 32
0
        public void Enumerator_TraversesInCorrectOrder()
        {
            _container = new FakeBaseContainer(3, 3);

            var queue = new Queue<object>(_container.Size);
            queue.Enqueue(_container[0, 0]);
            queue.Enqueue(_container[0, 1]);
            queue.Enqueue(_container[0, 2]);
            queue.Enqueue(_container[1, 0]);
            queue.Enqueue(_container[1, 1]);
            queue.Enqueue(_container[1, 2]);
            queue.Enqueue(_container[2, 0]);
            queue.Enqueue(_container[2, 1]);
            queue.Enqueue(_container[2, 2]);

            Assert.That(_container.Size, Is.EqualTo(queue.Count));

            foreach (var item in _container)
            {
                Assert.That(item, Is.SameAs(queue.Dequeue()));
            }
        }
Exemplo n.º 33
0
        public void ToList_IsCorrect(int w, int h)
        {
            _container = new FakeBaseContainer(w, h);

            Assert.That(_container.ToList(), Has.Count.EqualTo(w * h));
        }
Exemplo n.º 34
0
 public void SetUp()
 {
     _container = new FakeBaseContainer(11, 15);
 }
Exemplo n.º 35
0
        public void Size_EqualTo_Count(int w, int h)
        {
            _container = new FakeBaseContainer(w, h);

            Assert.That(_container.Size, Is.EqualTo(_container.Count()));
        }
Exemplo n.º 36
0
        public void Size_EqualTo_WidthMultiplyHeight(int w, int h)
        {
            _container = new FakeBaseContainer(w, h);

            Assert.That(_container.Size, Is.EqualTo(w * h));
        }
Exemplo n.º 37
0
        public void Width_ReturnsCorrectValue(int w, int h)
        {
            _container = new FakeBaseContainer(w, h);

            Assert.That(_container.Width, Is.EqualTo(w));
        }
Exemplo n.º 38
0
        public void Height_ReturnsCorrectValue(int w, int h)
        {
            _container = new FakeBaseContainer(w, h);

            Assert.That(_container.Height, Is.EqualTo(h));
        }