protected UnitEntity buildCube() { UnitEntity e = new UnitEntity(); UnitServices unitservices = new UnitServices(); unitservices.AddService(typeof(IUnitEntityType), e); GraphicComponent graphic = new GraphicComponent(); // get provided services // init each component initializeComponent(graphic, unitservices); graphic.LoadContent(); e.Components.Add(graphic); return(e); }
protected void initializeComponent(BaseUnitComponent component, UnitServices unitServices) { component.Initialize(unitServices, this.serviceProvider); }