public virtual void setAttribute(String key, object value, Attribute.Type type) { Attribute attr; if ((type == Attribute.Type.BOOL) && (!((bool)value))) { attr = null; } else { attr = new Attribute(type, value); } this.setRawAttribute(key, attr); }
private int GetAtribute(Attribute.Type type) { int result = 0; foreach (Attribute attribute in CatCharacter.attributes) { if (attribute.type == type) { result += attribute.value; } } foreach (MoodletEffect mood in CatCharacter.effects) { foreach (Attribute effect in mood.effects) { if (effect.type == type) { result += effect.value; } } } return(result); }
public AttributeReplacement(String key, object value, Attribute.Type type) : base(key) { this.value = value; this.type = type; }