public MGBAccountBaseSerializable(MGBAccountBase source) { this.ID = source.ID; this.Name = source.Name; this.Login = source.Login; this.Password = source.Password; this.Position = source.Position; }
//value comparison not reference //ID and Name must be unique for different accounts //same Login and Position = same account public bool ValuesEquals(MGBAccountBase baseAccount) { if (baseAccount.ID == this._id || baseAccount.Name == this._name) { return(true); } else if (baseAccount.Login == this._login && baseAccount.Position == this._position) { return(true); } else { return(false); } }
//if wrong values returns default public bool ValidatedCopy(MGBAccountBase source) { this._id = source.ID; this._name = source.Name; this._login = source.Login; this._password = source.Password; this._position = source.Position; this._used = source.Used; this._pointsLeft = source.PointsLeft; if (this.Validate()) { return(true); } else { this.Reset(); return(false); } }
public MGBAccountBase(MGBAccountBase source) { this.ValidatedCopy(source); }
public MGBAccount(MGBAccountBase source) : this() { this._accountBase = source; }
//probably shouldn't exist empty object private MGBAccount() { this._accountBase = new MGBAccountBase(); this._gamesLeft = new MGBRewardArray(); this._gameType = MiniGameType.None; }