Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using GrimoireEngine.Framework.Interfaces;
- namespace GrimoireEngine.Framework.Collections
- {
- public class BattleAttributes : IEquatable<BattleAttributes>, ICopy<BattleAttributes>
- {
- private int _accuracy;
- private int _evasion;
- private int _initiative;
- private int _movmement;
- private int _acrobatics;
- public int Accuracy
- {
- get { return _accuracy; }
- set { _accuracy = value; }
- }
- public int Evasion
- {
- get { return _evasion; }
- set { _evasion = value; }
- }
- public int Initiative
- {
- get { return _initiative; }
- set { _initiative = value; }
- }
- public int Movmement
- {
- get { return _movmement; }
- set { _movmement = value; }
- }
- public int Acrobatics
- {
- get { return _acrobatics; }
- set { _acrobatics = value; }
- }
- public BattleAttributes()
- {
- }
- public BattleAttributes(int accuracy, int evasion, int initiative, int movmement, int acrobatics)
- {
- Copy(accuracy,evasion,initiative,movmement,acrobatics);
- }
- public void Copy(int accuracy, int evasion, int initiative, int movmement, int acrobatics)
- {
- this.Accuracy = accuracy;
- this.Evasion = evasion;
- this.Initiative = initiative;
- this.Movmement = movmement;
- this.Acrobatics = acrobatics;
- }
- public bool Equals(BattleAttributes other)
- {
- if (ReferenceEquals(null, other)) return false;
- if (ReferenceEquals(this, other)) return true;
- return _accuracy == other._accuracy && _evasion == other._evasion && _initiative == other._initiative && _movmement == other._movmement && _acrobatics == other._acrobatics;
- }
- public override bool Equals(object obj)
- {
- if (ReferenceEquals(null, obj)) return false;
- if (ReferenceEquals(this, obj)) return true;
- if (obj.GetType() != this.GetType()) return false;
- return Equals((BattleAttributes) obj);
- }
- public override int GetHashCode()
- {
- unchecked
- {
- int hashCode = _accuracy;
- hashCode = (hashCode * 397) ^ _evasion;
- hashCode = (hashCode * 397) ^ _initiative;
- hashCode = (hashCode * 397) ^ _movmement;
- hashCode = (hashCode * 397) ^ _acrobatics;
- return hashCode;
- }
- }
- public void Copy(BattleAttributes other)
- {
- this._accuracy = other._accuracy;
- this._evasion = other._evasion;
- this._initiative = other._initiative;
- this._movmement = other._movmement;
- this._acrobatics = other._acrobatics;
- }
- public BattleAttributes MakeCopy()
- {
- BattleAttributes copy = new BattleAttributes();
- copy.Copy(this);
- return copy;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement