コード例 #1
0
        public bool SetPlayer(PlayerMatchData player)
        {
            for (int i = 0; i < _data.playersMatchData.Count; i++)
            {
                if (_data.playersMatchData[i].playerProfile == player.playerProfile)
                {
                    _data.playersMatchData[i] = player;
                    return(true);
                }
            }

            return(false);
        }
コード例 #2
0
        private void InitMatchData(string levelConfigId)
        {
            _data.playersMatchData.Clear();

            PlayerMatchData playerMatchData = new PlayerMatchData();

            playerMatchData.itemsInUse    = inventoryStateModel.GetItemsInUse();
            playerMatchData.playerProfile = socialStateModel.GetState();
            playerMatchData.matchStatus   = MatchStatus.Playing;
            _data.playersMatchData.Add(playerMatchData);

            _data.levelMatchData = new LevelMatchData();
            if (levelConfigId != "-1")
            {
                _data.levelMatchData.levelConfigId = levelConfigId;
            }
        }
コード例 #3
0
        public object Clone()
        {
            PlayerMatchData c = new PlayerMatchData();

            c.playerProfile    = playerProfile.Clone() as SocialStateData;
            c.playerType       = playerType;
            c.currenciesEarned = currenciesEarned.Select(currency => currency.Clone() as GameElementData).ToList();
            c.xpGained         = xpGained;
            c.score            = score;
            c.progress         = progress.Select(p => p.Clone() as GameElementData).ToList();
            c.itemsInUse       = itemsInUse.Select(item => item.Clone() as ItemData).ToList();
            c.properties       = properties.Select(p => p.Clone() as GameElementData).ToList();
            c.matchStatus      = matchStatus;
            c.index            = index;

            return(c);
        }