World.cs 715 B

1234567891011121314151617181920212223242526
  1. namespace Model
  2. {
  3. public class World : GameObject<World>
  4. {
  5. private static readonly World instance = new World();
  6. public static World Instance
  7. {
  8. get
  9. {
  10. return instance;
  11. }
  12. }
  13. private World()
  14. {
  15. this.AddComponent<UnitComponent>();
  16. ConfigComponent configComponent = this.AddComponent<ConfigComponent>();
  17. configComponent.Load(new[] { typeof (World).Assembly });
  18. FactoryComponent<Unit> factoryComponent = this.AddComponent<FactoryComponent<Unit>>();
  19. factoryComponent.Load(new[] { typeof(World).Assembly });
  20. }
  21. }
  22. }