Пример #1
0
        public override string ToString()
        {
            char   s    = Separator;
            string data = $"{Species,-7}{s}{_age,5}{s}{_hp,5}{s}{_energy,5}{s}{_food,5}{s}{_water,5}";

            if (!Extended)
            {
                return(data);
            }

            if (TruncateTo == 0)
            {
                data += $"{s}{MM.Urge,-9}{s}{MoodManager.EmotionName(MM),-12}{s}{MM.Mood,-8}"
                        + $"{s}{_deathBy,-13}{s}{(MM.Asleep ? "yes" : "no"),-6}";
            }
            else
            {
                object[] elements =
                {
                    MM.Urge, MoodManager.EmotionName(MM), MM.Mood, _deathBy, MM.Asleep ? "yes" : "no"
                };

                foreach (object element in elements)
                {
                    data += s + Truncate(element.ToString(), TruncateTo, 1);
                }
            }

            return(data);
        }
Пример #2
0
        public object[] ToObjectArray()
        {
            if (!Extended)
            {
                return(new object[] { Species, _age, _hp, _energy, _food, _water });
            }

            return(new object[] {
                Species, _age, _hp, _energy, _food, _water,
                MM.Urge, MoodManager.EmotionName(MM), MM.Mood, _deathBy, MM.Asleep ? "Yes" : "No"
            });
        }