示例#1
0
        public void RemoveModifier(int id, ResourceModifier resourceModifier)
        {
            Resource resource = getResourceByType(resourceModifier.ResourceType);

            resource.RemoveModifier(id, resourceModifier);
            resource.ApplyModifiers();
        }
示例#2
0
 public void RemoveModifier(int id, ResourceModifier resourceModifier)
 {
     if (Modifiers.ContainsKey(id))
     {
         Modifiers.Remove(id);
     }
 }
示例#3
0
        private void AddModifier(int id, ResourceModifier resourceModifier)
        {
            Resource resource = getResourceByType(resourceModifier.ResourceType);

            resource.AddModifier(id, resourceModifier);
            resource.ApplyModifiers();
        }
示例#4
0
        public void AddModifier(int id, ResourceModifier resourceModifier)
        {
            if (resourceModifier.ResourceModifierType == ResourceModifierType.Amount)
            {
                Amount += resourceModifier;
            }
            else
            {
                if (!Modifiers.ContainsKey(id))
                {
                    Modifiers.Add(id, new List <ResourceModifier>());
                }

                Modifiers[id].Add(resourceModifier);
            }
        }