Exemplo n.º 1
0
    private LevelContext CreateContext(LevelData leveldata)
    {
        CardLoader      _cardLoader      = new CardLoader();
        MonsterLoader   monsterLoader    = new MonsterLoader();
        CharacterLoader _characterLoader = new CharacterLoader();

        //init level context
        LevelContext context = new LevelContext();

        context.LevelData = leveldata;
        context.Player    = _characterLoader.LoadUserCharacter();
        context.EnemyList.AddRange(monsterLoader.LoadEnemies(leveldata.Level, leveldata.Mission));
        context.ElementCardList.AddRange(_cardLoader.LoadUserCards(context.Player.Properties.ElementCards));
        context.UltimateCardList.AddRange(_cardLoader.LoadUltimateCards(context.Player.Properties.UltimateCards));

        return(context);
    }