Ejemplo n.º 1
0
    public void Start(Map mapInfos)
    {
        PositionProvider pp;

        Loaded    = true;
        _mapInfos = mapInfos;
        _turn     = 0;
        Finished  = false;
        _lives    = mapInfos.Lives;
        _board.PassThroughVirus = mapInfos.passThroughtVirus;

        pp = new PositionProvider(new Vector2(0, 0), new Vector2Int(mapInfos.Rows, mapInfos.Cols), 1); // tmp

        _board.Init(pp);
        _environment.Init(pp);
        _actionQueue.Init(pp);

        _actionQueue.SetMaxAction(_lives);

        /*LINK GRAPHIC AND MAP*/

        _board.SetMap(mapInfos.Data);

        /*SPELL*/

        _spellManager = new SpellManager();
        _spellManager.Add(InputAction.Spell.ACCELERATION, new Spell(InputAction.Spell.ACCELERATION, Spell.ReloadType.COOLDOWN, mapInfos.AccelerationCD, false));
        _spellManager.Add(InputAction.Spell.DELETE_VIRUS, new Spell(InputAction.Spell.DELETE_VIRUS, Spell.ReloadType.USAGE, mapInfos.SprayUses, true));
        _spellManager.AttachDisplay(InputAction.Spell.ACCELERATION, "AccelerationSpell");
        _spellManager.AttachDisplay(InputAction.Spell.DELETE_VIRUS, "AntivirusSpraySpell");

        /*DRAW*/

        _board.Draw();
        _environment.Draw();
        _actionQueue.Draw();

        /*CAMERA*/

        PositionCamera(pp);

        /*DISPLAY*/

        _displayManager = new DisplayManager();
        _displayManager.AddText("LivesText", "Lives");
        _displayManager.Texts["Lives"].Update(_lives.ToString());
    }