Skip to content

Commit

Permalink
formatting etc
Browse files Browse the repository at this point in the history
  • Loading branch information
baughj committed May 20, 2024
1 parent 5ff881d commit 638534e
Show file tree
Hide file tree
Showing 18 changed files with 37 additions and 69 deletions.
1 change: 1 addition & 0 deletions src/Extensions/Creature.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
// For contributors and individual authors please refer to CONTRIBUTORS.MD.

using System;
using System.Linq;
using System.Xml.Serialization;
using Hybrasyl.Xml.Interfaces;
using Hybrasyl.Xml.Manager;
Expand Down
19 changes: 3 additions & 16 deletions src/Extensions/HybrasylEntity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,30 +16,17 @@
//
// For contributors and individual authors please refer to CONTRIBUTORS.MD.

/* Unmerged change from project 'Hybrasyl.Xml (net7.0)'
Before:
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Hybrasyl.Xml.Enums;
After:
using Hybrasyl.Xml.Enums;
using Hybrasyl.Collections.Interfaces;
using System.Xml.Manager;
using Hybrasyl.Xml.Interfaces;
using Hybrasyl.Xml.Manager;
using Newtonsoft.Json;
using Newtonsoft.Json.Bson;
using Hybrasyl.NET;
*/

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Hybrasyl.Xml.Enums;
using Hybrasyl.Xml.Interfaces;
using Pluralize.NET;

namespace Hybrasyl.Xml.Objects;

Expand Down
11 changes: 6 additions & 5 deletions src/Extensions/Variant.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public Item ResolveVariant(Item originalItem)
// ensure boot hiding is carried to variants
variantItem.Properties.Appearance.HideBoots = originalItem.Properties.Appearance.HideBoots;
if (Properties.Restrictions?.Level != null)
variantItem.Properties.Restrictions.Level.Min = (byte) Math.Min(99,
variantItem.Properties.Restrictions.Level.Min = (byte)Math.Min(99,
variantItem.Properties.Restrictions.Level.Min + Properties.Restrictions.Level.Min);

if (Properties.Appearance != null)
Expand All @@ -60,13 +60,13 @@ public Item ResolveVariant(Item originalItem)
if (originalItem.Properties.Equipment.Slot == EquipmentSlot.Weapon && Properties.Damage != null)
{
variantItem.Properties.Damage.LargeMin =
(ushort) (originalItem.Properties.Damage.LargeMin * Properties.Damage.LargeMin);
(ushort)(originalItem.Properties.Damage.LargeMin * Properties.Damage.LargeMin);
variantItem.Properties.Damage.LargeMax =
(ushort) (originalItem.Properties.Damage.LargeMax * Properties.Damage.LargeMax);
(ushort)(originalItem.Properties.Damage.LargeMax * Properties.Damage.LargeMax);
variantItem.Properties.Damage.SmallMin =
(ushort) (originalItem.Properties.Damage.SmallMin * Properties.Damage.SmallMin);
(ushort)(originalItem.Properties.Damage.SmallMin * Properties.Damage.SmallMin);
variantItem.Properties.Damage.SmallMin =
(ushort) (originalItem.Properties.Damage.SmallMin * Properties.Damage.SmallMin);
(ushort)(originalItem.Properties.Damage.SmallMin * Properties.Damage.SmallMin);
}

if (Properties.StatModifiers?.BaseDefensiveElement != null)
Expand All @@ -83,6 +83,7 @@ public Item ResolveVariant(Item originalItem)
variantItem.Properties.StatModifiers.BaseDefensiveElement =
Properties.StatModifiers?.BaseOffensiveElement ?? ElementType.None;

variantItem.Properties.Tags.AddRange(Properties.Tags);
return variantItem;
}
}
10 changes: 2 additions & 8 deletions src/Interfaces/IWorldDataManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,11 @@
// For contributors and individual authors please refer to CONTRIBUTORS.MD.

using System;
using System.Collections.Generic;
using Hybrasyl.Xml.Enums;
using Hybrasyl.Xml.Manager;
using Hybrasyl.Xml.Objects;

/* Unmerged change from project 'Hybrasyl.Xml (net7.0)'
Before:
using System;
After:
using System.Collections.Generic;
*/

using Serilog;

namespace Hybrasyl.Xml.Interfaces;

Expand Down
23 changes: 0 additions & 23 deletions src/Manager/XmlManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,31 +27,8 @@
using Hybrasyl.Xml.Enums;
using Hybrasyl.Xml.Interfaces;
using Hybrasyl.Xml.Objects;

/* Unmerged change from project 'Hybrasyl.Xml (net7.0)'
Before:
using System.Linq;
using System.Reflection;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;
using Hybrasyl.Xml.Enums;
using Hybrasyl.Xml.Interfaces;
using Hybrasyl.Xml.Objects;
using Pluralize.NET;
using Serilog;
After:
using Pluralize.NET;
using Serilog;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Hybrasyl.Xml.Reflection;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;
*/

namespace Hybrasyl.Xml.Manager;

Expand Down
4 changes: 2 additions & 2 deletions src/Objects/Creature.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public partial class Creature : HybrasylEntity<Creature>
private string _behaviorSet;
private int _minDmg;
private int _maxDmg;
private sbyte _assailSound;
private byte _assailSound;
#endregion

public Creature()
Expand Down Expand Up @@ -178,7 +178,7 @@ public int MaxDmg
}

[XmlAttribute]
public sbyte AssailSound
public byte AssailSound
{
get
{
Expand Down
5 changes: 2 additions & 3 deletions src/Objects/ElementTableSourceElement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,11 @@ public partial class ElementTableSourceElement : HybrasylEntity<ElementTableSour
{
#region Private fields
private List<ElementTableTargetElement> _target;
private List<ElementType> _element;
private ElementType _element;
#endregion

public ElementTableSourceElement()
{
_element = new List<ElementType>();
_target = new List<ElementTableTargetElement>();
}

Expand All @@ -51,7 +50,7 @@ public List<ElementTableTargetElement> Target
}

[XmlAttribute]
public List<ElementType> Element
public ElementType Element
{
get
{
Expand Down
8 changes: 2 additions & 6 deletions src/Objects/ElementTableTargetElement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,13 @@ namespace Hybrasyl.Xml.Objects
public partial class ElementTableTargetElement : HybrasylEntity<ElementTableTargetElement>
{
#region Private fields
private List<ElementType> _element;
private ElementType _element;
private double _multiplier;
#endregion

public ElementTableTargetElement()
{
_element = new List<ElementType>();
}

[XmlAttribute]
public List<ElementType> Element
public ElementType Element
{
get
{
Expand Down
9 changes: 3 additions & 6 deletions src/Objects/EquipmentRestriction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,17 @@ namespace Hybrasyl.Xml.Objects
public partial class EquipmentRestriction : HybrasylEntity<EquipmentRestriction>
{
#region Private fields
private List<WeaponType> _weaponType;

private WeaponType _weaponType = WeaponType.None;
private EquipmentSlot _slot;
private RestrictionType _restrictionType;
private string _message;
private string _value;
#endregion

public EquipmentRestriction()
{
_weaponType = new List<WeaponType>();
}

[XmlAttribute]
public List<WeaponType> WeaponType
public WeaponType WeaponType
{
get
{
Expand Down
1 change: 1 addition & 0 deletions tests/Entities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
// For contributors and individual authors please refer to CONTRIBUTORS.MD.

using Hybrasyl.Xml.Objects;
using Xunit;

namespace Hybrasyl.XmlTests;

Expand Down
2 changes: 2 additions & 0 deletions tests/Immunities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
// For contributors and individual authors please refer to CONTRIBUTORS.MD.

using Hybrasyl.Xml.Objects;
using Xunit;
using Xunit.Abstractions;

namespace Hybrasyl.XmlTests;

Expand Down
1 change: 1 addition & 0 deletions tests/Localization.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
// For contributors and individual authors please refer to CONTRIBUTORS.MD.

using Hybrasyl.Xml.Objects;
using Xunit;

namespace Hybrasyl.XmlTests;

Expand Down
3 changes: 3 additions & 0 deletions tests/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
//
// For contributors and individual authors please refer to CONTRIBUTORS.MD.

using Newtonsoft.Json;
using Serilog;

namespace Hybrasyl.XmlTests;

public class Settings
Expand Down
1 change: 1 addition & 0 deletions tests/StoreKey.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
// For contributors and individual authors please refer to CONTRIBUTORS.MD.

using Hybrasyl.Xml.Manager;
using Xunit;

namespace Hybrasyl.XmlTests;

Expand Down
2 changes: 2 additions & 0 deletions tests/XmlEntities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
// For contributors and individual authors please refer to CONTRIBUTORS.MD.

using Hybrasyl.Xml.Objects;
using Xunit;
using Xunit.Abstractions;

namespace Hybrasyl.XmlTests;

Expand Down
4 changes: 4 additions & 0 deletions tests/XmlManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
using Hybrasyl.Xml.Enums;
using Hybrasyl.Xml.Manager;
using Hybrasyl.Xml.Objects;
using Serilog;
using Serilog.Sinks.TestCorrelator;
using Xunit;
using Xunit.Abstractions;

[assembly: CollectionBehavior(DisableTestParallelization = true)]

Expand Down
1 change: 1 addition & 0 deletions tests/XmlManagerFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

using System.Diagnostics;
using Hybrasyl.Xml.Manager;
using Serilog;

namespace Hybrasyl.XmlTests;

Expand Down
1 change: 1 addition & 0 deletions tests/XmlStore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
using Hybrasyl.Xml.Enums;
using Hybrasyl.Xml.Manager;
using Hybrasyl.Xml.Objects;
using Xunit;

namespace Hybrasyl.XmlTests;

Expand Down

0 comments on commit 638534e

Please sign in to comment.