示例#1
0
        void EntityDecay_Test()
        {
            try
            {
                Entity Ent = null;
                if (World.GetWorld().Entities.ToArray().Length > 0)
                {
                    Ent = World.GetWorld().Entities.ToArray()[0];
                }
                if (Ent == null)
                {
                    Log("EntityDecay_Test: Ent == null!");
                }

                Log("EntityDecay_Test: Test 1");
                Hooks.EntityDecay(Ent, 0f);

                Log("EntityDecay_Test: Test 2");
                Hooks.EntityDecay(Ent, -100f);

                Log("EntityDecay_Test: Test 3");
                Hooks.EntityDecay(Ent, 10000f);

                Log("EntityDecay_Test: Test 4");
                Hooks.EntityDecay(null, 0f);

                Log("EntityDecay_Test: Test 5");
                Hooks.EntityDecay(null, 10000f);

                Ent = new Entity(new object());

                Log("EntityDecay_Test: Test 6");
                Hooks.EntityDecay(Ent, 0f);

                Log("EntityDecay_Test: Test 7");
                Hooks.EntityDecay(Ent, 10000f);
            }
            catch (Exception ex)
            {
                Logger.LogException(ex);
            }
        }