CreateContext() public static method

public static CreateContext ( ) : Context,
return 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);
        }
    }
    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();
 }