CreateContext() публичный статический Метод

public static CreateContext ( ) : Context,
Результат Context,
Пример #1
0
    public void Before()
    {
        var context = Helper.CreateContext();

        _e          = context.CreateEntity();
        _componentA = new ComponentA();
    }
 public void Before()
 {
     _context = Helper.CreateContext();
     _context.GetGroup(Matcher <Entity> .AllOf(new [] { CP.ComponentA }));
     _context.GetGroup(Matcher <Entity> .AllOf(new [] { CP.ComponentB }));
     _context.GetGroup(Matcher <Entity> .AllOf(new [] { CP.ComponentC }));
     _context.GetGroup(Matcher <Entity> .AllOf(new [] {
         CP.ComponentA,
         CP.ComponentB
     }));
     _context.GetGroup(Matcher <Entity> .AllOf(new [] {
         CP.ComponentA,
         CP.ComponentC
     }));
     _context.GetGroup(Matcher <Entity> .AllOf(new [] {
         CP.ComponentB,
         CP.ComponentC
     }));
     _context.GetGroup(Matcher <Entity> .AllOf(new [] {
         CP.ComponentA,
         CP.ComponentB,
         CP.ComponentC
     }));
     _e = _context.CreateEntity();
     _e.AddComponent(CP.ComponentA, new ComponentA());
 }
Пример #3
0
    public void Before()
    {
        var context = Helper.CreateContext();
        var group   = context.GetGroup(Matcher <Entity> .AllOf(new [] { CP.ComponentA }));

        _collector = group.CreateCollector();
    }
Пример #4
0
 public void Before()
 {
     _context = Helper.CreateContext();
     for (int i = 0; i < n; i++)
     {
         _context.CreateEntity();
     }
 }
    public void Before()
    {
        var context = Helper.CreateContext();

        _e = context.CreateEntity();
        _e.AddComponent(CP.ComponentA, new ComponentA());
        _e.AddComponent(CP.ComponentB, new ComponentB());
        _e.AddComponent(CP.ComponentC, new ComponentC());
    }
Пример #6
0
    public void Before()
    {
        _context = Helper.CreateContext();
        _index   = new PrimaryEntityIndex <Entity, string>(_context.GetGroup(Matcher <Entity> .AllOf(CP.ComponentA)), (e, c) => ((NameComponent)c).name);

        for (int i = 0; i < 10; i++)
        {
            var nameComponent = new NameComponent();
            nameComponent.name = i.ToString();
            _context.CreateEntity().AddComponent(CP.ComponentA, nameComponent);
        }
    }
Пример #7
0
    public void Before()
    {
        _context = Helper.CreateContext();

        var e         = _context.CreateEntity();
        var component = new NameAgeComponent();

        component.name = "Max";
        component.age  = 42;
        e.AddComponent(CP.ComponentA, component);

        _blueprint = new Blueprint(string.Empty, string.Empty, e);
    }
Пример #8
0
    public void Before()
    {
        var context = Helper.CreateContext();
        var group   = context.GetGroup(Matcher <Entity> .AllOf(new [] { CP.ComponentA }));

        _collector = group.CreateCollector();

        for (int i = 0; i < 1000; i++)
        {
            var e = context.CreateEntity();
            e.AddComponent(CP.ComponentA, new ComponentA());
        }
    }
Пример #9
0
 public void Before()
 {
     _context = Helper.CreateContext();
 }