World.cs 743 B

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