示例#1
0
        public Entity Create <T>(params object[] args)
            where T : IGameEntity
        {
            Entity      entity     = _world.CreateEntity();
            IGameEntity gameObject = _context.ResolveNamed <IGameEntity>(typeof(T).ToString());

            gameObject.BuildEntity(entity, args);
            return(entity);
        }
示例#2
0
        public Entity Create <TEntity, TArgument>(TArgument args)
            where TEntity : IGameEntity <TArgument>
            where TArgument : class
        {
            Entity entity = _world.CreateEntity();
            IGameEntity <TArgument> gameObject = _context.Resolve <IGameEntity <TArgument> >();

            gameObject.BuildEntity(entity, args);
            return(entity);
        }