public override string ToString() { string objective = ""; if (type != ObjectiveType.GoTo && type != ObjectiveType.Exit) { objective += type.ToString() + " a " + targetObject + "\n"; } else { objective += type.ToString() + " the " + targetZone + "\n"; } return(objective); }
/// @return The serialized data /// public object Serialize() { var jsonData = new JsonDictionary() { { k_keyType, m_type.ToString() } }; if (m_type == ObjectiveType.Chain && m_value > 0) { jsonData.Add(k_keyValue, m_value); } if (m_type == ObjectiveType.Colour && m_target != TileColour.None) { jsonData.Add(k_keyTarget, m_target.ToString()); } if (m_amount > 0) { jsonData.Add(k_keyAmount, m_amount); } return(jsonData); }