Beispiel #1
0
        public InventoryTests()
        {
            InitScript.Init();

            {
                entityFactory = new EntityFactory();

                // AddComponents
                var transform    = Transform.AddTo(entityFactory, Layers.REAL, TransformFlags.Default);
                var stats        = Stats.AddTo(entityFactory, Registry.Global.Stats._map);
                var acting       = Acting.AddTo(entityFactory, null, Algos.SimpleAlgo, Order.Player);
                var moving       = Moving.AddTo(entityFactory);
                var displaceable = Displaceable.AddTo(entityFactory, Layers.BLOCK);
                var inventory    = Inventory.AddTo(entityFactory);
                var ticking      = Ticking.AddTo(entityFactory);

                // InitComponents
                acting.DefaultPreset(entityFactory);
                moving.DefaultPreset();
                displaceable.DefaultPreset();
                ticking.DefaultPreset();

                // Retouch
                Equip.OnDisplaceHandlerWrapper.HookTo(entityFactory);

                Inventory.AddInitTo(entityFactory);
            }

            {
                itemFactory = new EntityFactory();
                var transform = Transform.AddTo(itemFactory, Layers.ITEM, 0);
            }
        }
Beispiel #2
0
        public MovingTests()
        {
            InitScript.Init();

            entityFactory = new EntityFactory();
            Transform.AddTo(entityFactory, Layers.REAL, 0);
            Stats.AddTo(entityFactory, Registry.Global.Stats._map);
            Displaceable.AddTo(entityFactory, Layers.BLOCK).DefaultPreset();
            Moving.AddTo(entityFactory).DefaultPreset();
        }
Beispiel #3
0
        public TargetingTests()
        {
            InitScript.Init();

            wallFactory = new EntityFactory();
            Transform.AddTo(wallFactory, Layers.WALL, 0);
            Attackable.AddTo(wallFactory, Attackness.IS_BLOCK);

            entityFactory = new EntityFactory();
            Transform.AddTo(entityFactory, Layers.REAL, 0);
            Attackable.AddTo(entityFactory, Attackness.ALWAYS);
        }
Beispiel #4
0
        public GridTests()
        {
            InitScript.Init();

            wallFactory = new EntityFactory();
            Transform.AddTo(wallFactory, Layers.WALL, 0);

            entityFactory = new EntityFactory();
            Transform.AddTo(entityFactory, Layers.REAL, TransformFlags.Default);

            directionalBlockFactory = new EntityFactory();
            Transform.AddTo(directionalBlockFactory, Layers.WALL, TransformFlags.Directed);
        }
Beispiel #5
0
        public AttackingTests()
        {
            InitScript.Init();

            // attacking requires stats and transform
            attackerFactory = new EntityFactory();
            Transform.AddTo(attackerFactory, Layers.REAL, 0);
            Stats.AddTo(attackerFactory, Registry.Global.Stats._map);
            Attacking.AddTo(attackerFactory, entity => BufferedAttackTargetProvider.Simple, Layers.REAL, Faction.Any).SkipEmptyAttackPreset();


            attackedFactory = new EntityFactory();
            Transform.AddTo(attackedFactory, Layers.REAL, 0);
            FactionComponent.AddTo(attackedFactory, Faction.Environment);
            Stats.AddTo(attackedFactory, Registry.Global.Stats._map);
            Attackable.AddTo(attackedFactory, Attackness.ALWAYS);
        }
Beispiel #6
0
 public MoreChainTests()
 {
     InitScript.Init();
 }
Beispiel #7
0
 public ControllableTests()
 {
     InitScript.Init();
 }
Beispiel #8
0
 public WorldTests()
 {
     InitScript.Init();
 }
Beispiel #9
0
 public Prediction_Tests()
 {
     InitScript.Init();
 }