Пример #1
0
    public Contexts()
    {
        action    = new ActionContext();
        factory   = new FactoryContext();
        game      = new GameContext();
        grid      = new GridContext();
        input     = new InputContext();
        mapEditor = new MapEditorContext();
        meta      = new MetaContext();
        request   = new RequestContext();

        var postConstructors = System.Linq.Enumerable.Where(
            GetType().GetMethods(),
            method => System.Attribute.IsDefined(method, typeof(Entitas.CodeGeneration.Attributes.PostConstructorAttribute))
            );

        foreach (var postConstructor in postConstructors)
        {
            postConstructor.Invoke(this, null);
        }
    }
Пример #2
0
 public static MapEditorEntity GetEntityWithId(this MapEditorContext context, int value)
 {
     return(((Entitas.PrimaryEntityIndex <MapEditorEntity, int>)context.GetEntityIndex(Contexts.Id)).GetEntity(value));
 }
Пример #3
0
 public static MapEditorEntity GetEntityWithAssetBay(this MapEditorContext context, int id)
 {
     return(((Entitas.PrimaryEntityIndex <MapEditorEntity, int>)context.GetEntityIndex(Contexts.AssetBay)).GetEntity(id));
 }