Пример #1
0
        public void SerializeNewAppearance(
            [NotNull] string username,
            PlayerAppearance appearance,
            [NotNull] PlayerEquipmentContainer equipment)
        {
            if (username == null)
            {
                throw new ArgumentNullException(nameof(username));
            }
            if (equipment == null)
            {
                throw new ArgumentNullException(nameof(equipment));
            }

            var sizePlaceholder = BeginWriteApperance();

            WriteGender(appearance);
            WriteOverheads();
            WriteBodyObjects(appearance, equipment);
            WriteBodyColors(appearance);
            WriteAnimationIndices();
            WriteUsername(username);
            WriteCombatLevel();
            WriteSkillLevel();

            EndWriteAppearance(sizePlaceholder);
        }
Пример #2
0
 public PlayerInventoryComponent(
     [NotNull] IEntity parent,
     [NotNull] ListItemContainer backpack,
     [NotNull] PlayerEquipmentContainer equipment,
     [NotNull] ListItemContainer bank) : base(parent)
 {
     Backpack  = backpack ?? throw new ArgumentNullException(nameof(backpack));
     Equipment = equipment ?? throw new ArgumentNullException(nameof(equipment));
     Bank      = bank ?? throw new ArgumentNullException(nameof(bank));
 }
Пример #3
0
        public PlayerAppearanceMessage(string username, PlayerAppearance appearance, [NotNull] PlayerEquipmentContainer equipment)
        {
            if (string.IsNullOrEmpty(username))
            {
                throw new ArgumentException("message", nameof(username));
            }

            Username   = username;
            Appearance = appearance;
            Equipment  = equipment ?? throw new ArgumentNullException(nameof(equipment));
        }