public static CharacterCode CreateFrom(BasicCharacterObject character)
        {
            CharacterCode characterCode = new CharacterCode();
            string        equipmentCode = character.Equipment?.CalculateEquipmentCode();

            characterCode.EquipmentCode  = equipmentCode;
            characterCode.BodyProperties = character.GetBodyProperties(character.Equipment);
            characterCode.IsFemale       = character.IsFemale;
            characterCode.IsHero         = character.IsHero;
            characterCode.FormationClass = character.DefaultFormationClass;
            MBStringBuilder mbStringBuilder = new MBStringBuilder();

            mbStringBuilder.Initialize(callerMemberName: nameof(CreateFrom));
            mbStringBuilder.Append <string>("@---@");
            mbStringBuilder.Append <string>(equipmentCode);
            mbStringBuilder.Append <string>("@---@");
            mbStringBuilder.Append <string>(characterCode.BodyProperties.ToString());
            mbStringBuilder.Append <string>("@---@");
            mbStringBuilder.Append <string>(characterCode.IsFemale ? "1" : "0");
            mbStringBuilder.Append <string>("@---@");
            mbStringBuilder.Append <string>(characterCode.IsHero ? "1" : "0");
            mbStringBuilder.Append <string>("@---@");
            mbStringBuilder.Append <string>(((int)characterCode.FormationClass).ToString());
            mbStringBuilder.Append <string>("@---@");
            mbStringBuilder.Append <string>(characterCode.Color1.ToString());
            mbStringBuilder.Append <string>("@---@");
            mbStringBuilder.Append <string>(characterCode.Color2.ToString());
            mbStringBuilder.Append <string>("@---@");
            characterCode.Code = mbStringBuilder.ToStringAndRelease();
            return(characterCode);
        }
Example #2
0
        public static void AddQuickInformation(
            TextObject message,
            int priorty = 0,
            BasicCharacterObject announcerCharacter = null,
            string soundEventPath = "")
        {
            Action <string, int, BasicCharacterObject, string> quickInformation = InformationManager.FiringQuickInformation;

            if (quickInformation != null)
            {
                quickInformation(message.ToString(), priorty, announcerCharacter, soundEventPath);
            }
            Debug.Print(message.ToString(), debugFilter: 1125899906842624UL);
        }