Esempio n. 1
0
    public void Init(PuzzelData data, Language language)
    {
        _language = language;

        _descriptionView.Init(data.DescriptionData);
        _playerBoardView.Init(data.PlayerData, GetPlayersHousesIcons(data.PlayerData.Houses));
        _opponentBoardView.Init(data.OponnentData, GetPlayersHousesIcons(data.OponnentData.Houses));

        LoadPlayerCards(data.PlayerData);
        LoadCards(data.OponnentData, _opponentBoardView);
    }
Esempio n. 2
0
    private void GeneratePuzzelData()
    {
        var descriptionData = new DescriptionData()
        {
            Number = _number, Title = _tittle, Description = _description
        };
        var playerJson = JsonConvert.SerializeObject(_playerData, Formatting.Indented, new JsonSerializerSettings {
            DefaultValueHandling = DefaultValueHandling.Ignore
        });
        PlayerBoardData playerData    = JsonConvert.DeserializeObject <PlayerBoardData>(playerJson);
        var             oppponentJson = JsonConvert.SerializeObject(_opponentData, Formatting.Indented, new JsonSerializerSettings {
            DefaultValueHandling = DefaultValueHandling.Ignore
        });
        PlayerBoardData opponentData = JsonConvert.DeserializeObject <PlayerBoardData>(oppponentJson);

        _puzzelData = new PuzzelData()
        {
            DescriptionData = descriptionData, PlayerData = playerData, OponnentData = opponentData
        };
    }