/// @param amount /// The new amount /// public void OnAmountChanged(string amount) { if (int.TryParse(amount, out int integer) && m_objectiveData.m_amount.ToString() != amount) { m_objectiveData.m_amount = integer; RefreshUI(); OnObjectiveChanged.SafeInvoke(m_index, m_objectiveData); } }
/// @param value /// The new value /// public void OnValueChanged(string value) { if (int.TryParse(value, out int integer) && m_objectiveData.m_value.ToString() != value) { m_objectiveData.m_value = integer; RefreshUI(); OnObjectiveChanged.SafeInvoke(m_index, m_objectiveData); } }
/// Called when the player changes the target of the objective /// public void OnTargetNext() { var targetCount = Enum.GetValues(typeof(TileColour)).Length; var targetIndex = (int)m_objectiveData.m_target + 1; if (targetIndex >= targetCount) { targetIndex = 1; } m_objectiveData.m_target = (TileColour)targetIndex; RefreshUI(); OnObjectiveChanged.SafeInvoke(m_index, m_objectiveData); }
/// Called when the player changes the type of the objective /// public void OnTypeNext() { var typeCount = Enum.GetValues(typeof(ObjectiveType)).Length; int typeIndex = (int)m_objectiveData.m_type + 1; if (typeIndex >= typeCount) { typeIndex = 0; } m_objectiveData.m_type = (ObjectiveType)typeIndex; RefreshUI(); OnObjectiveChanged.SafeInvoke(m_index, m_objectiveData); }