Exemplo n.º 1
0
 /// <summary>
 /// Intializes a new <see cref="Attribute"/>
 /// </summary>
 /// <param name="type">The type of attribute</param>
 /// <param name="operation">The attribute operation to use</param>
 /// <param name="value">The value to use in the operation</param>
 /// <param name="slot">The slot the attribute effect works in</param>
 public Attribute(ID.AttributeType type, ID.AttributeOperation operation, MCRange value, ID.AttributeSlot slot)
 {
     Type      = type;
     Operation = operation;
     Value     = value;
     Slot      = new ID.AttributeSlot[] { slot };
 }
Exemplo n.º 2
0
 /// <summary>
 /// Gets an attribute modifer from an entity
 /// </summary>
 /// <param name="selector">Selector which selects the entity to get the modifier from</param>
 /// <param name="attribute">The attribute to get the modifier from</param>
 /// <param name="uuid">The UUID of the modifier</param>
 /// <param name="scale">A value to multiply the attribute modifier with before outputting</param>
 public void GetModifier(BaseSelector selector, ID.AttributeType attribute, UUID uuid, double scale)
 {
     selector.LimitSelector();
     Function.AddCommand(new AttributeGetModifierCommand(selector, attribute, uuid, scale));
 }
Exemplo n.º 3
0
 /// <summary>
 /// Removes an attribute modifer from an entity
 /// </summary>
 /// <param name="selector">Selector which selects the entity to remove the modifier from</param>
 /// <param name="attribute">The attribute to remove the modifier from</param>
 /// <param name="uuid">The UUID of the modifier</param>
 public void RemoveModifier(BaseSelector selector, ID.AttributeType attribute, UUID uuid)
 {
     selector.LimitSelector();
     Function.AddCommand(new AttributeRemoveModifierCommand(selector, attribute, uuid));
 }
Exemplo n.º 4
0
 /// <summary>
 /// Adds an attribute modifer to an entity
 /// </summary>
 /// <param name="selector">Selector which selects the entity to add the modifier to</param>
 /// <param name="attribute">The attribute to add the modifier to</param>
 /// <param name="uuid">The UUID of the modifier</param>
 /// <param name="name">The name of the modifier</param>
 /// <param name="value">The value of the modifier</param>
 /// <param name="operation">The modifier's operation</param>
 public void AddModifier(BaseSelector selector, ID.AttributeType attribute, UUID uuid, string name, double value, ID.AttributeOperation operation)
 {
     selector.LimitSelector();
     Function.AddCommand(new AttributeAddModifierCommand(selector, attribute, uuid, name, value, operation));
 }
Exemplo n.º 5
0
 /// <summary>
 /// Sets the base value of an attribute
 /// </summary>
 /// <param name="selector">Selector which selects the entity to set the attribute base for</param>
 /// <param name="attribute">The attribute base to set</param>
 /// <param name="value">The value to set the base to</param>
 public void SetBase(BaseSelector selector, ID.AttributeType attribute, double value)
 {
     selector.LimitSelector();
     Function.AddCommand(new AttributeSetBaseCommand(selector, attribute, value));
 }
Exemplo n.º 6
0
 /// <summary>
 /// Gets the base value of an attribute
 /// </summary>
 /// <param name="selector">Selector which selects the entity to get the attribute base for</param>
 /// <param name="attribute">The attribute base to get</param>
 /// <param name="scale">A value to multiply the attribute base with before outputting</param>
 public void GetBase(BaseSelector selector, ID.AttributeType attribute, double scale = 1)
 {
     selector.LimitSelector();
     Function.AddCommand(new AttributeGetBaseCommand(selector, attribute, scale));
 }
Exemplo n.º 7
0
 /// <summary>
 /// Intializes a new <see cref="AttributeGetBaseCommand"/>
 /// </summary>
 /// <param name="selector">Selector which selects the entity to get the attribute base for</param>
 /// <param name="attribute">The attribute to get the base for</param>
 /// <param name="scale">A value to multiply the attribute base with before outputting</param>
 public AttributeGetBaseCommand(BaseSelector selector, ID.AttributeType attribute, double scale)
 {
     Selector  = selector;
     Attribute = attribute;
     Scale     = scale;
 }