Пример #1
0
    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);
    }
Пример #2
0
        /// @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);
        }