Ejemplo n.º 1
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]);
    }