Example #1
0
        public void SetWorldObjectLevelData(string configurationId, WorldObjectLevelData newLevelData)
        {
            var levelData = _worldObjectLevels.Find(w => w.Id == configurationId);

            if (levelData != null)
            {
                levelData.Level             = newLevelData.Level;
                levelData.IsManagerAssigned = newLevelData.IsManagerAssigned;
                levelData.IdleMining        = newLevelData.IdleMining;
            }
            else
            {
                levelData = new WorldObjectLevelData
                {
                    Id                = configurationId,
                    Level             = newLevelData.Level,
                    IsManagerAssigned = newLevelData.IsManagerAssigned,
                    IdleMining        = newLevelData.IdleMining
                };

                _worldObjectLevels.Add(levelData);
            }

            _totalIdleMining = CalculateTotalIdleMining();
        }
Example #2
0
        public WorldObjectLevelData GetWorldObjectLevelData(string configurationId)
        {
            var levelData = _worldObjectLevels.Find(w => w.Id == configurationId);

            if (levelData != null)
            {
                return(levelData);
            }

            levelData = new WorldObjectLevelData
            {
                Id                = configurationId,
                Level             = 0,
                IsManagerAssigned = false
            };

            _worldObjectLevels.Add(levelData);
            return(levelData);
        }