Beispiel #1
0
        private void TrainingDone(Sync sync)
        {
            UserInfoRow          user       = sync.MainUser;
            JSONTable_BaseDefend baseDefend = sync.CurrentBaseDefend;
            BaseDefendRow        defendRow  = baseDefend.ReadOnlyRows.FirstOrDefault(r => r.ID_Unit == TrainingUnit_ID);

            if (defendRow == null)
            {
                baseDefend.Insert(new BaseDefendRow()
                {
                    BaseNumber = BaseNumber,
                    ID_Unit    = TrainingUnit_ID,
                    Quality    = TrainingQuality,
                });
            }
            else
            {
                defendRow.Quality += TrainingQuality;
            }

            user.Might     += Training_Might;
            TrainingUnit_ID = 0;
            TrainingQuality = 0;
            Training_Might  = 0;
        }
Beispiel #2
0
        public int CompareTo(object obj)
        {
            BaseDefendRow other = obj as BaseDefendRow;

            return(ID_Unit.CompareTo(other.ID_Unit));
        }