Ejemplo n.º 1
0
        public World()
        {
            Rng.Seed(0);

            Status = WorldStatus.Created;

            TagManager    = new TagManager <string>();
            GroupManager  = new GroupManager <string>();
            EntityFactory = new EntityFactory();
            EntityManager = new EntityManager();
            Log           = new GameLog();

            EntityManager.EntityAdded   += EntityManager_EntityAdded;
            EntityManager.EntityRemoved += EntityManager_EntityRemoved;

            ItemFactory.Init(EntityFactory);
            FeatureFactory.Init(EntityFactory);
            PersonFactory.Init(EntityFactory);
            TestEntityFactory.Init(EntityFactory);

            EntityFactory.Compile();

            MapFactory = new MapFactory(this);

            Calendar       = new Calendar();
            CalendarEntity = EntityManager.Create(new List <Component>
            {
                new ControllerComponent(Calendar, new AP(World.OneSecondInSpeed / 2))
            });

//			ActionProcessed += World_ActionProcessed;
        }
Ejemplo n.º 2
0
        public void TestIllegalInherits()
        {
            EntityFactory entityFactory = new EntityFactory();

            entityFactory.Inherits("1", "2", new Identifier("blah"));

            entityFactory.Compile();
        }
Ejemplo n.º 3
0
        public void SetUp()
        {
            _ef = new EntityFactory();
            _em = new EntityManager();

            _ef.Add("base", new Identifier("Item"), new Sprite("base", 1));
            _ef.Add("item", new Identifier("Item"), new Sprite("item", 1));
            _ef.Inherits("inherited", "base", new Sprite("inherited", 2));
            _ef.Compile();
        }