예제 #1
0
        private void Draw(WorldStateChange change)
        {
            _worldState = change.Perform(WorldStateChangeAware.Instance)(_worldState);

            var world = _worldBuilder.BuildWorld(_worldState);

            _renderer.Render(world, _backBuffer);
            pictureBox1.Image = _backBuffer;

            var exchange = _backBuffer;

            _backBuffer  = _frontBuffer;
            _frontBuffer = exchange;
        }
예제 #2
0
    void Start()
    {
        var goodTeam = new Team();

        undeadTeam = new Team();
        goodTeam.Enemies.Add(undeadTeam);
        undeadTeam.Enemies.Add(goodTeam);
        rand = new System.Random(1);
        fP   = new FactoryProvider();
        fP.Initialize();
        var islandIndex = new TopDownCircleSpaceIndex(500);

        fP.InterIslandCollisionFactory.TopdownIslandIndex = islandIndex;
        var unityViewFactory = new UnityViewFactory();

        fP.IslandElementUnityViewFactory.UnityViewFactory = unityViewFactory;
        InventoryDatabase inventoryDatabase = new InventoryDatabase(unityViewFactory);

        unitBuilder = new UnitBuilder(fP.IslandElementFactory, unityViewFactory, inventoryDatabase);
        var worldBuilder = new WorldBuilder(unitBuilder, new BuildingBuilder(), unityViewFactory, inventoryDatabase);

        worldBuilder.BuildWorld(fP);
        islands = fP.IslandFactory.elements;
        var elementTypes = new List <IElementalType> {
            new Magma(), new Lightning(), new Psychic(), new Toxic(), new Water()
        };

        foreach (var eType in elementTypes.Skip(4))
        {
            var onIsland = islands[0];
            var position = new Vector3(eType.GetName().Length - 6, 0, eType.DamageMultiplierAgainst(new Magma()) - 2);
            units.Add(unitBuilder.GetWizard(eType, onIsland, position, goodTeam));
        }
        cam           = new FollowCamera();
        minimap       = new Minimap(islandIndex, cam);
        inventoryView = new CoolInventoryView(new GameObjectManager(), cam, new ModelToEntity());
        inventoryView.SetDatabase(inventoryDatabase);
        FocusOnUnit(units[0]);
    }
예제 #3
0
 public void BuildGame()
 {
     builder.BuildWorld();
 }