public WorldProperty(WorldProperty property, PropertyValue overwriteValue) { ObjectID = property.ObjectID; Property = property.Property; Key = property.Key; Value = overwriteValue; }
public void SetState(WorldProperty property) { switch (property.Property) { case EProperty.MoneyEqual: _money[property.ObjectID] = property.Value.iVal; return; case EProperty.MoneyGreaterThan: _money[property.ObjectID] = property.Value.iVal + 1; return; case EProperty.MoneyLessThan: _money[property.ObjectID] = property.Value.iVal - 1; return; } int toUpdate = _worldProperties.FindIndex(prop => prop.Key == property.Key); if (toUpdate != -1) { _worldProperties[toUpdate] = new WorldProperty(_worldProperties[toUpdate], property.Value); } else { _worldProperties.Add(property); } }
public void FromRuntimeProperty(WorldProperty property, bool generateGuid) { _objectType = property.GetObjectClass(); _objectIndex = property.GetClassIndex(); Property = property.Property; iValue = property.Value.iVal; bValue = property.Value.bVal; fValue = property.Value.fVal; if (generateGuid) { #if UNITY_EDITOR guid = GUID.Generate().ToString(); #else Debug.LogError("Can't generate guid in a build"); #endif //UNITY_EDITOR } }
public bool IsInState(WorldProperty property) { if (property.Property == EProperty.MoneyEqual || property.Property == EProperty.MoneyGreaterThan || property.Property == EProperty.MoneyLessThan) { return(Query(property.Key, null, property.Value)); } List <WorldProperty> propertiesWithID = _worldProperties.FindAll(prop => prop.ObjectID == property.ObjectID); if (propertiesWithID.Count > 0) { foreach (WorldProperty withID in propertiesWithID) { if (withID.Property == property.Property) { return(Query(withID.Key, withID.Value, property.Value)); } } } return(false); }
public PropertyValue(WorldProperty worldProperty) { iVal = worldProperty.Value.iVal; bVal = worldProperty.Value.bVal; fVal = worldProperty.Value.fVal; }
public PropertyKey(WorldProperty worldProperty) { ObjectID = worldProperty.ObjectID; _property = (int)worldProperty.Property; }
public void SetState(WorldProperty property) { _state.SetState(property); }
public bool IsInState(WorldProperty property) { return(_state.IsInState(property)); }