예제 #1
0
파일: Actor.cs 프로젝트: nate0001/AIR
        public Actor(int id, string name)
        {
            Id = id;
            Name = name;

            Abilities = new Dictionary<int, Ability>();
            CurrentAbilities = new Dictionary<int, Ability>();

            Skills = new Dictionary<int, Skill>();
            CurrentSkills = new Dictionary<int, Skill>();

            Traits = new Dictionary<int, Trait>();
            CurrentTraits = new Dictionary<int, Trait>();

            Classes = new EventListCollection<Class>();
            Classes.ListAdded += ClassAdded;
            Classes.ListRemoved += ClassRemoved;

            Effects = new EventListCollection<Effect>();
            Effects.ListAdded += EffectAdded;
            Effects.ListRemoved += EffectRemoved;

            Modifiers = new EventListCollection<Modifier>();
            Modifiers.ListAdded += ModifierAdded;
            Modifiers.ListRemoved += ModifierRemoved;

            Equipment = new Equipment();
            Equipment.EquipmentList.DictionaryAdded += EquipmentAdded;
            Equipment.EquipmentList.DictionaryRemoved += EquipmentRemoved;

            _baseStats = new Stat();
            _baseStats.Properties.PropertyChanged += PropertyChanged;
            _effectiveStats = new Stat();
            _effectiveStats.Properties.PropertyChanged += PropertyChanged;

            _numPointWeights = new[] {25, 25, 25, 25};

            _events = new CombatEvents();

            _properties = new PropertyNotificationObject();
            _properties.PropertyChanged += PropertyChanged;

            _random = new Random();
        }
예제 #2
0
파일: Stat.cs 프로젝트: nate0001/AIR
        public bool Equals(Stat other)
        {
            if (ReferenceEquals(null, other))
                return false;

            if (ReferenceEquals(this, other))
                return true;

            return Equals(other._values, _values) && Equals(other.Properties, Properties);
        }
예제 #3
0
파일: Stat.cs 프로젝트: nate0001/AIR
        public static Stat operator /(Stat a, int b)
        {
            var stat = new Stat();

            foreach (var pair in a._values)
                stat[pair.Key] = a[pair.Key] + b;

            return stat;
        }
예제 #4
0
파일: Stat.cs 프로젝트: nate0001/AIR
        public static Stat operator -(Stat a, Stat b)
        {
            var stat = new Stat();

            foreach (var pair in a._values)
                stat[pair.Key] = a[pair.Key] - b[pair.Key];

            return stat;
        }