Use BinaryData 2.0.0 RC to load ProjectX data more automatically.

This commit is contained in:
Ray Koopa 2017-05-01 19:55:14 +02:00
parent 5e23aef58c
commit ff042f1fc2
63 changed files with 249 additions and 1310 deletions

View File

@ -1,6 +1,3 @@
using System;
using System.IO;
using System.Collections.Generic;
using Syroot.Worms.Gen2.Armageddon.ProjectX; using Syroot.Worms.Gen2.Armageddon.ProjectX;
namespace Syroot.Worms.Test namespace Syroot.Worms.Test
@ -14,13 +11,8 @@ namespace Syroot.Worms.Test
private static void Main(string[] args) private static void Main(string[] args)
{ {
Library library = new Library(@"D:\Archive\Games\Worms\Worms Armageddon\3.6.31.0\Libs\cnades.pxl"); Library library = new Library(@"D:\Pictures\loadme.pxl");
library.Save(@"D:\Pictures\saved.pxl"); library.Save(@"D:\Pictures\saved.pxl");
//Scheme pxScheme = new Scheme(@"D:\Archive\Games\Worms\Worms Armageddon\3.6.31.0\PXSchemes\PacStruction.pxs");
Console.WriteLine("Done.");
Console.ReadLine();
} }
} }
} }

View File

@ -2,7 +2,7 @@ using System.Diagnostics;
using System.IO; using System.IO;
using System.Reflection; using System.Reflection;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using Syroot.IO; using Syroot.BinaryData;
namespace Syroot.Worms.Core namespace Syroot.Worms.Core
{ {

View File

@ -1,7 +1,7 @@
using System.Diagnostics; using System.Diagnostics;
using System.IO; using System.IO;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using Syroot.IO; using Syroot.BinaryData;
namespace Syroot.Worms.Core namespace Syroot.Worms.Core
{ {

View File

@ -3,7 +3,7 @@ using System.Collections.Generic;
using System.IO; using System.IO;
using System.Reflection; using System.Reflection;
using System.Text; using System.Text;
using Syroot.IO; using Syroot.BinaryData;
namespace Syroot.Worms.Core namespace Syroot.Worms.Core
{ {

View File

@ -2,7 +2,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Text; using System.Text;
using Syroot.IO; using Syroot.BinaryData;
using Syroot.Worms.Core; using Syroot.Worms.Core;
namespace Syroot.Worms.Gen2 namespace Syroot.Worms.Gen2

View File

@ -1,6 +1,6 @@
using System.IO; using System.IO;
using System.Text; using System.Text;
using Syroot.IO; using Syroot.BinaryData;
using Syroot.Worms.Core; using Syroot.Worms.Core;
namespace Syroot.Worms.Gen2.Armageddon namespace Syroot.Worms.Gen2.Armageddon

View File

@ -1,6 +1,6 @@
using System.IO; using System.IO;
using System.Text; using System.Text;
using Syroot.IO; using Syroot.BinaryData;
using Syroot.Maths; using Syroot.Maths;
using Syroot.Worms.Core; using Syroot.Worms.Core;

View File

@ -1,22 +0,0 @@
using System.IO;
using Syroot.Worms.Core;
namespace Syroot.Worms.Gen2.Armageddon.ProjectX
{
public abstract class ActionBase : ILoadable, ISaveable
{
// ---- METHODS (PUBLIC) ---------------------------------------------------------------------------------------
/// <summary>
/// Loads the data from the given <see cref="Stream"/>.
/// </summary>
/// <param name="stream">The <see cref="Stream"/> to load the data from.</param>
public abstract void Load(Stream stream);
/// <summary>
/// Saves the data into the given <paramref name="stream"/>.
/// </summary>
/// <param name="stream">The <see cref="Stream"/> to save the data to.</param>
public abstract void Save(Stream stream);
}
}

View File

@ -0,0 +1,44 @@
using System;
using Syroot.BinaryData;
namespace Syroot.Worms.Gen2.Armageddon.ProjectX
{
internal class ActionConverter : IBinaryConverter
{
// ---- METHODS (PUBLIC) ---------------------------------------------------------------------------------------
public object Read(BinaryDataReader reader, object instance, BinaryMemberAttribute memberAttribute)
{
ExplosionAction explosionAction;
switch (instance)
{
case LauncherStyle launcherStyle:
explosionAction = launcherStyle.ExplosionAction;
break;
case ClusterTarget clusterTarget:
explosionAction = clusterTarget.ExplosionAction;
break;
default:
throw new NotImplementedException();
}
switch (explosionAction)
{
case ExplosionAction.Bounce:
return reader.ReadObject<BounceAction>();
case ExplosionAction.Dig:
return reader.ReadObject<DigAction>();
case ExplosionAction.Home:
return reader.ReadObject<HomeAction>();
case ExplosionAction.Roam:
return reader.ReadObject<RoamAction>();
}
return null;
}
public void Write(BinaryDataWriter writer, object instance, BinaryMemberAttribute memberAttribute, object value)
{
writer.WriteObject(value);
}
}
}

View File

@ -1,10 +1,6 @@
using System.IO;
using System.Text;
using Syroot.IO;
namespace Syroot.Worms.Gen2.Armageddon.ProjectX namespace Syroot.Worms.Gen2.Armageddon.ProjectX
{ {
public class BounceAction : ActionBase public class BounceAction : IAction
{ {
// ---- PROPERTIES --------------------------------------------------------------------------------------------- // ---- PROPERTIES ---------------------------------------------------------------------------------------------
@ -29,51 +25,5 @@ namespace Syroot.Worms.Gen2.Armageddon.ProjectX
public int DamageRandomness { get; set; } public int DamageRandomness { get; set; }
public int BounceCount { get; set; } public int BounceCount { get; set; }
// ---- METHODS (PUBLIC) ---------------------------------------------------------------------------------------
/// <summary>
/// Loads the data from the given <see cref="Stream"/>.
/// </summary>
/// <param name="stream">The <see cref="Stream"/> to load the data from.</param>
public override void Load(Stream stream)
{
using (BinaryDataReader reader = new BinaryDataReader(stream, Encoding.ASCII, true))
{
Collisions = reader.ReadEnum<CollisionFlags>(false);
Bounciness = reader.ReadInt32();
Acceleration = reader.ReadInt32();
Sound = reader.ReadInt32();
Unknown1 = reader.ReadInt32();
Unknown2 = reader.ReadInt32();
ExplosionBias = reader.ReadInt32();
ExplosionPower = reader.ReadInt32();
ExplosionDamage = reader.ReadInt32();
DamageRandomness = reader.ReadInt32();
BounceCount = reader.ReadInt32();
}
}
/// <summary>
/// Saves the data into the given <paramref name="stream"/>.
/// </summary>
/// <param name="stream">The <see cref="Stream"/> to save the data to.</param>
public override void Save(Stream stream)
{
using (BinaryDataWriter writer = new BinaryDataWriter(stream, Encoding.ASCII, true))
{
writer.Write(Collisions, true);
writer.Write(Bounciness);
writer.Write(Acceleration);
writer.Write(Sound);
writer.Write(Unknown1);
writer.Write(Unknown2);
writer.Write(ExplosionBias);
writer.Write(ExplosionPower);
writer.Write(ExplosionDamage);
writer.Write(DamageRandomness);
writer.Write(BounceCount);
}
}
} }
} }

View File

@ -1,10 +1,6 @@
using System.IO;
using System.Text;
using Syroot.IO;
namespace Syroot.Worms.Gen2.Armageddon.ProjectX namespace Syroot.Worms.Gen2.Armageddon.ProjectX
{ {
public class DigAction : ActionBase public class DigAction : IAction
{ {
// ---- PROPERTIES --------------------------------------------------------------------------------------------- // ---- PROPERTIES ---------------------------------------------------------------------------------------------
@ -21,43 +17,5 @@ namespace Syroot.Worms.Gen2.Armageddon.ProjectX
public int Sprite2 { get; set; } public int Sprite2 { get; set; }
public int Sprite3 { get; set; } public int Sprite3 { get; set; }
// ---- METHODS (PUBLIC) ---------------------------------------------------------------------------------------
/// <summary>
/// Loads the data from the given <see cref="Stream"/>.
/// </summary>
/// <param name="stream">The <see cref="Stream"/> to load the data from.</param>
public override void Load(Stream stream)
{
using (BinaryDataReader reader = new BinaryDataReader(stream, Encoding.ASCII, true))
{
Unknown1 = reader.ReadInt32();
Unknown2 = reader.ReadInt32();
DiggingSound = reader.ReadInt32();
SpriteJumping = reader.ReadInt32();
Sprite1 = reader.ReadInt32();
Sprite2 = reader.ReadInt32();
Sprite3 = reader.ReadInt32();
}
}
/// <summary>
/// Saves the data into the given <paramref name="stream"/>.
/// </summary>
/// <param name="stream">The <see cref="Stream"/> to save the data to.</param>
public override void Save(Stream stream)
{
using (BinaryDataWriter writer = new BinaryDataWriter(stream, Encoding.ASCII, true))
{
writer.Write(Unknown1);
writer.Write(Unknown2);
writer.Write(DiggingSound);
writer.Write(SpriteJumping);
writer.Write(Sprite1);
writer.Write(Sprite2);
writer.Write(Sprite3);
}
}
} }
} }

View File

@ -1,14 +1,12 @@
using System.IO; using Syroot.BinaryData;
using System.Text;
using Syroot.IO;
using Syroot.Worms.Core;
namespace Syroot.Worms.Gen2.Armageddon.ProjectX namespace Syroot.Worms.Gen2.Armageddon.ProjectX
{ {
public class HomeAction : ActionBase public class HomeAction : IAction
{ {
// ---- PROPERTIES --------------------------------------------------------------------------------------------- // ---- PROPERTIES ---------------------------------------------------------------------------------------------
[BinaryMember(Offset = 4)]
public Sprite Sprite { get; set; } public Sprite Sprite { get; set; }
public HomeStyle HomeStyle { get; set; } public HomeStyle HomeStyle { get; set; }
@ -16,40 +14,6 @@ namespace Syroot.Worms.Gen2.Armageddon.ProjectX
public int Delay { get; set; } public int Delay { get; set; }
public int Duration { get; set; } public int Duration { get; set; }
// ---- METHODS (PUBLIC) ---------------------------------------------------------------------------------------
/// <summary>
/// Loads the data from the given <see cref="Stream"/>.
/// </summary>
/// <param name="stream">The <see cref="Stream"/> to load the data from.</param>
public override void Load(Stream stream)
{
using (BinaryDataReader reader = new BinaryDataReader(stream, Encoding.ASCII, true))
{
reader.Seek(4);
Sprite = reader.ReadStruct<Sprite>();
HomeStyle = reader.ReadEnum<HomeStyle>(false);
Delay = reader.ReadInt32();
Duration = reader.ReadInt32();
}
}
/// <summary>
/// Saves the data into the given <paramref name="stream"/>.
/// </summary>
/// <param name="stream">The <see cref="Stream"/> to save the data to.</param>
public override void Save(Stream stream)
{
using (BinaryDataWriter writer = new BinaryDataWriter(stream, Encoding.ASCII, true))
{
writer.Write(0);
writer.Write(Sprite);
writer.Write(HomeStyle);
writer.Write(Delay);
writer.Write(Duration);
}
}
} }
public enum HomeStyle public enum HomeStyle

View File

@ -0,0 +1,6 @@
namespace Syroot.Worms.Gen2.Armageddon.ProjectX
{
public interface IAction
{
}
}

View File

@ -1,10 +1,8 @@
using System.IO; using Syroot.BinaryData;
using System.Text;
using Syroot.IO;
namespace Syroot.Worms.Gen2.Armageddon.ProjectX namespace Syroot.Worms.Gen2.Armageddon.ProjectX
{ {
public class RoamAction : ActionBase public class RoamAction : IAction
{ {
// ---- PROPERTIES --------------------------------------------------------------------------------------------- // ---- PROPERTIES ---------------------------------------------------------------------------------------------
@ -30,6 +28,7 @@ namespace Syroot.Worms.Gen2.Armageddon.ProjectX
public int TerrainOffset { get; set; } public int TerrainOffset { get; set; }
[BinaryMember(BooleanFormat = BinaryBooleanFormat.NonZeroDword)]
public bool Fart { get; set; } public bool Fart { get; set; }
public int DiseasePower { get; set; } public int DiseasePower { get; set; }
@ -43,65 +42,5 @@ namespace Syroot.Worms.Gen2.Armageddon.ProjectX
public int SpriteTakeOff { get; set; } public int SpriteTakeOff { get; set; }
public int SpriteDuringFlight { get; set; } public int SpriteDuringFlight { get; set; }
// ---- METHODS (PUBLIC) ---------------------------------------------------------------------------------------
/// <summary>
/// Loads the data from the given <see cref="Stream"/>.
/// </summary>
/// <param name="stream">The <see cref="Stream"/> to load the data from.</param>
public override void Load(Stream stream)
{
using (BinaryDataReader reader = new BinaryDataReader(stream, Encoding.ASCII, true))
{
RoamCollisions = reader.ReadEnum<CollisionFlags>(false);
ExplosionCollisions = reader.ReadEnum<CollisionFlags>(false);
WalkSpeed = reader.ReadInt32();
Unknown = reader.ReadInt32();
JumpAngleEdge = reader.ReadInt32();
JumpVelocityEdge = reader.ReadInt32();
JumpSoundEdge = reader.ReadInt32();
JumpAngle = reader.ReadInt32();
JumpVelocity = reader.ReadInt32();
JumpSound = reader.ReadInt32();
TerrainOffset = reader.ReadInt32();
Fart = reader.ReadBoolean(BinaryBooleanFormat.NonZeroDword);
DiseasePower = reader.ReadInt32();
SpriteFarting = reader.ReadInt32();
SpriteFlying = reader.ReadInt32();
SpriteFlying2 = reader.ReadInt32();
SpriteTakeOff = reader.ReadInt32();
SpriteDuringFlight = reader.ReadInt32();
}
}
/// <summary>
/// Saves the data into the given <paramref name="stream"/>.
/// </summary>
/// <param name="stream">The <see cref="Stream"/> to save the data to.</param>
public override void Save(Stream stream)
{
using (BinaryDataWriter writer = new BinaryDataWriter(stream, Encoding.ASCII, true))
{
writer.Write(RoamCollisions, true);
writer.Write(ExplosionCollisions, true);
writer.Write(WalkSpeed);
writer.Write(Unknown);
writer.Write(JumpAngleEdge);
writer.Write(JumpVelocityEdge);
writer.Write(JumpSoundEdge);
writer.Write(JumpAngle);
writer.Write(JumpVelocity);
writer.Write(JumpSound);
writer.Write(TerrainOffset);
writer.Write(Fart, BinaryBooleanFormat.NonZeroDword);
writer.Write(DiseasePower);
writer.Write(SpriteFarting);
writer.Write(SpriteFlying);
writer.Write(SpriteFlying2);
writer.Write(SpriteTakeOff);
writer.Write(SpriteDuringFlight);
}
}
} }
} }

View File

@ -1,5 +1,5 @@
using System; using System;
using Syroot.IO; using Syroot.BinaryData;
namespace Syroot.Worms.Gen2.Armageddon.ProjectX namespace Syroot.Worms.Gen2.Armageddon.ProjectX
{ {

View File

@ -4,7 +4,7 @@ using System.Diagnostics;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using Syroot.IO; using Syroot.BinaryData;
using Syroot.Worms.Core; using Syroot.Worms.Core;
namespace Syroot.Worms.Gen2.Armageddon.ProjectX namespace Syroot.Worms.Gen2.Armageddon.ProjectX

View File

@ -2,7 +2,6 @@ using System.Runtime.InteropServices;
namespace Syroot.Worms.Gen2.Armageddon.ProjectX namespace Syroot.Worms.Gen2.Armageddon.ProjectX
{ {
[StructLayout(LayoutKind.Sequential)]
public struct Mine public struct Mine
{ {
public int Sensitivity; public int Sensitivity;

View File

@ -1,7 +1,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Text; using System.Text;
using Syroot.IO; using Syroot.BinaryData;
using Syroot.Worms.Core; using Syroot.Worms.Core;
namespace Syroot.Worms.Gen2.Armageddon.ProjectX namespace Syroot.Worms.Gen2.Armageddon.ProjectX

View File

@ -1,25 +1,19 @@
using System.Runtime.InteropServices; using Syroot.BinaryData;
namespace Syroot.Worms.Gen2.Armageddon.ProjectX namespace Syroot.Worms.Gen2.Armageddon.ProjectX
{ {
[StructLayout(LayoutKind.Explicit)]
public struct Sound public struct Sound
{ {
[FieldOffset(0)]
public short SoundIndex; public short SoundIndex;
// One byte goes unused here as marshalling does not support 2-byte booleans. [BinaryMember(BooleanFormat = BinaryBooleanFormat.NonZeroWord)]
[FieldOffset(3)]
public bool RepeatSound; public bool RepeatSound;
[FieldOffset(4)] [BinaryMember(BooleanFormat = BinaryBooleanFormat.NonZeroDword)]
public bool UseExplosionSound; public bool UseExplosionSound;
[FieldOffset(8)]
public int SoundBeforeExplosion; public int SoundBeforeExplosion;
[FieldOffset(12)]
public int DelayBeforeExplosion; public int DelayBeforeExplosion;
} }
} }

View File

@ -2,7 +2,6 @@ using System.Runtime.InteropServices;
namespace Syroot.Worms.Gen2.Armageddon.ProjectX namespace Syroot.Worms.Gen2.Armageddon.ProjectX
{ {
[StructLayout(LayoutKind.Sequential)]
public struct Sprite public struct Sprite
{ {
public int SpriteNumber; public int SpriteNumber;

View File

@ -1,12 +1,8 @@
using System; using Syroot.BinaryData;
using System.IO;
using System.Text;
using Syroot.IO;
using Syroot.Worms.Core;
namespace Syroot.Worms.Gen2.Armageddon.ProjectX namespace Syroot.Worms.Gen2.Armageddon.ProjectX
{ {
public class AirstrikeStyle : StyleBase public class AirstrikeStyle : IStyle
{ {
// ---- PROPERTIES --------------------------------------------------------------------------------------------- // ---- PROPERTIES ---------------------------------------------------------------------------------------------
@ -20,63 +16,13 @@ namespace Syroot.Worms.Gen2.Armageddon.ProjectX
public int Sound; public int Sound;
public WeaponAirstrikeAction Action; public WeaponAirstrikeSubstyle AirstrikeSubstyle;
public StyleBase Style; [BinaryMember(Converter = typeof(AirstrikeSubstyleConverter))]
public IStyle Style;
// ---- METHODS (PUBLIC) ---------------------------------------------------------------------------------------
/// <summary>
/// Loads the data from the given <see cref="Stream"/>.
/// </summary>
/// <param name="stream">The <see cref="Stream"/> to load the data from.</param>
public override void Load(Stream stream)
{
using (BinaryDataReader reader = new BinaryDataReader(stream, Encoding.ASCII, true))
{
PlaneSprite = reader.ReadInt32();
BombsCount = reader.ReadInt32();
DropDistance = reader.ReadInt32();
HorizontalSpeed = reader.ReadInt32();
Sound = reader.ReadInt32();
Action = reader.ReadEnum<WeaponAirstrikeAction>(false);
switch (Action)
{
case WeaponAirstrikeAction.Launcher:
Style = reader.Load<LauncherStyle>();
break;
case WeaponAirstrikeAction.Mines:
Style = reader.Load<MineStyle>();
break;
}
}
} }
/// <summary> public enum WeaponAirstrikeSubstyle : int
/// Saves the data into the given <paramref name="stream"/>.
/// </summary>
/// <param name="stream">The <see cref="Stream"/> to save the data to.</param>
public override void Save(Stream stream)
{
using (BinaryDataWriter writer = new BinaryDataWriter(stream, Encoding.ASCII, true))
{
writer.Write(PlaneSprite);
writer.Write(BombsCount);
writer.Write(DropDistance);
writer.Write(HorizontalSpeed);
writer.Write(Sound);
writer.Write(Action, true);
if (Action != WeaponAirstrikeAction.Worms)
{
writer.Save(Style);
}
}
}
}
public enum WeaponAirstrikeAction : int
{ {
Mines, Mines,
Worms, Worms,

View File

@ -0,0 +1,37 @@
using System;
using Syroot.BinaryData;
namespace Syroot.Worms.Gen2.Armageddon.ProjectX
{
public class AirstrikeSubstyleConverter : IBinaryConverter
{
// ---- METHODS (PUBLIC) ---------------------------------------------------------------------------------------
public object Read(BinaryDataReader reader, object instance, BinaryMemberAttribute memberAttribute)
{
WeaponAirstrikeSubstyle airstrikeSubstyle;
switch (instance)
{
case AirstrikeStyle airstrikeStyle:
airstrikeSubstyle = airstrikeStyle.AirstrikeSubstyle;
break;
default:
throw new NotImplementedException();
}
switch (airstrikeSubstyle)
{
case WeaponAirstrikeSubstyle.Launcher:
return reader.ReadObject<LauncherStyle>();
case WeaponAirstrikeSubstyle.Mines:
return reader.ReadObject<MineStyle>();
}
return null;
}
public void Write(BinaryDataWriter writer, object instance, BinaryMemberAttribute memberAttribute, object value)
{
writer.WriteObject(value);
}
}
}

View File

@ -1,45 +1,11 @@
using System;
using System.IO;
using System.Text;
using Syroot.IO;
using Syroot.Worms.Core;
namespace Syroot.Worms.Gen2.Armageddon.ProjectX namespace Syroot.Worms.Gen2.Armageddon.ProjectX
{ {
public class BaseballBatStyle : StyleBase public class BaseballBatStyle : IStyle
{ {
// ---- PROPERTIES --------------------------------------------------------------------------------------------- // ---- PROPERTIES ---------------------------------------------------------------------------------------------
public int Damage { get; set; } public int Damage { get; set; }
public int PushPower { get; set; } public int PushPower { get; set; }
// ---- METHODS (PUBLIC) ---------------------------------------------------------------------------------------
/// <summary>
/// Loads the data from the given <see cref="Stream"/>.
/// </summary>
/// <param name="stream">The <see cref="Stream"/> to load the data from.</param>
public override void Load(Stream stream)
{
using (BinaryDataReader reader = new BinaryDataReader(stream, Encoding.ASCII, true))
{
Damage = reader.ReadInt32();
PushPower = reader.ReadInt32();
}
}
/// <summary>
/// Saves the data into the given <paramref name="stream"/>.
/// </summary>
/// <param name="stream">The <see cref="Stream"/> to save the data to.</param>
public override void Save(Stream stream)
{
using (BinaryDataWriter writer = new BinaryDataWriter(stream, Encoding.ASCII, true))
{
writer.Write(Damage);
writer.Write(PushPower);
}
}
} }
} }

View File

@ -1,41 +1,9 @@
using System;
using System.IO;
using System.Text;
using Syroot.IO;
using Syroot.Worms.Core;
namespace Syroot.Worms.Gen2.Armageddon.ProjectX namespace Syroot.Worms.Gen2.Armageddon.ProjectX
{ {
public class BattleAxeStyle : StyleBase public class BattleAxeStyle : IStyle
{ {
// ---- PROPERTIES --------------------------------------------------------------------------------------------- // ---- PROPERTIES ---------------------------------------------------------------------------------------------
public int PercentualDamage { get; set; } public int PercentualDamage { get; set; }
// ---- METHODS (PUBLIC) ---------------------------------------------------------------------------------------
/// <summary>
/// Loads the data from the given <see cref="Stream"/>.
/// </summary>
/// <param name="stream">The <see cref="Stream"/> to load the data from.</param>
public override void Load(Stream stream)
{
using (BinaryDataReader reader = new BinaryDataReader(stream, Encoding.ASCII, true))
{
PercentualDamage = reader.ReadInt32();
}
}
/// <summary>
/// Saves the data into the given <paramref name="stream"/>.
/// </summary>
/// <param name="stream">The <see cref="Stream"/> to save the data to.</param>
public override void Save(Stream stream)
{
using (BinaryDataWriter writer = new BinaryDataWriter(stream, Encoding.ASCII, true))
{
writer.Write(PercentualDamage);
}
}
} }
} }

View File

@ -1,12 +1,6 @@
using System;
using System.IO;
using System.Text;
using Syroot.IO;
using Syroot.Worms.Core;
namespace Syroot.Worms.Gen2.Armageddon.ProjectX namespace Syroot.Worms.Gen2.Armageddon.ProjectX
{ {
public class BlowtorchStyle : StyleBase public class BlowtorchStyle : IStyle
{ {
// ---- PROPERTIES --------------------------------------------------------------------------------------------- // ---- PROPERTIES ---------------------------------------------------------------------------------------------
@ -17,37 +11,5 @@ namespace Syroot.Worms.Gen2.Armageddon.ProjectX
public int ImpactAngle { get; set; } public int ImpactAngle { get; set; }
public int TunellingTime { get; set; } public int TunellingTime { get; set; }
// ---- METHODS (PUBLIC) ---------------------------------------------------------------------------------------
/// <summary>
/// Loads the data from the given <see cref="Stream"/>.
/// </summary>
/// <param name="stream">The <see cref="Stream"/> to load the data from.</param>
public override void Load(Stream stream)
{
using (BinaryDataReader reader = new BinaryDataReader(stream, Encoding.ASCII, true))
{
Damage = reader.ReadInt32();
PushPower = reader.ReadInt32();
ImpactAngle = reader.ReadInt32();
TunellingTime = reader.ReadInt32();
}
}
/// <summary>
/// Saves the data into the given <paramref name="stream"/>.
/// </summary>
/// <param name="stream">The <see cref="Stream"/> to save the data to.</param>
public override void Save(Stream stream)
{
using (BinaryDataWriter writer = new BinaryDataWriter(stream, Encoding.ASCII, true))
{
writer.Write(Damage);
writer.Write(PushPower);
writer.Write(ImpactAngle);
writer.Write(TunellingTime);
}
}
} }
} }

View File

@ -1,39 +1,9 @@
using System.IO;
using System.Text;
using Syroot.IO;
namespace Syroot.Worms.Gen2.Armageddon.ProjectX namespace Syroot.Worms.Gen2.Armageddon.ProjectX
{ {
public class BowStyle : StyleBase public class BowStyle : IStyle
{ {
// ---- PROPERTIES --------------------------------------------------------------------------------------------- // ---- PROPERTIES ---------------------------------------------------------------------------------------------
public int Damage { get; set; } public int Damage { get; set; }
// ---- METHODS (PUBLIC) ---------------------------------------------------------------------------------------
/// <summary>
/// Loads the data from the given <see cref="Stream"/>.
/// </summary>
/// <param name="stream">The <see cref="Stream"/> to load the data from.</param>
public override void Load(Stream stream)
{
using (BinaryDataReader reader = new BinaryDataReader(stream, Encoding.ASCII, true))
{
Damage = reader.ReadInt32();
}
}
/// <summary>
/// Saves the data into the given <paramref name="stream"/>.
/// </summary>
/// <param name="stream">The <see cref="Stream"/> to save the data to.</param>
public override void Save(Stream stream)
{
using (BinaryDataWriter writer = new BinaryDataWriter(stream, Encoding.ASCII, true))
{
writer.Write(Damage);
}
}
} }
} }

View File

@ -1,10 +1,6 @@
using System.IO;
using System.Text;
using Syroot.IO;
namespace Syroot.Worms.Gen2.Armageddon.ProjectX namespace Syroot.Worms.Gen2.Armageddon.ProjectX
{ {
public class CanisterStyle : StyleBase public class CanisterStyle : IStyle
{ {
// ---- PROPERTIES --------------------------------------------------------------------------------------------- // ---- PROPERTIES ---------------------------------------------------------------------------------------------
@ -15,37 +11,5 @@ namespace Syroot.Worms.Gen2.Armageddon.ProjectX
public int DiseasePoints { get; set; } public int DiseasePoints { get; set; }
public int MaxDamage { get; set; } public int MaxDamage { get; set; }
// ---- METHODS (PUBLIC) ---------------------------------------------------------------------------------------
/// <summary>
/// Loads the data from the given <see cref="Stream"/>.
/// </summary>
/// <param name="stream">The <see cref="Stream"/> to load the data from.</param>
public override void Load(Stream stream)
{
using (BinaryDataReader reader = new BinaryDataReader(stream, Encoding.ASCII, true))
{
SpriteInactive = reader.ReadInt32();
SpriteActive = reader.ReadInt32();
DiseasePoints = reader.ReadInt32();
MaxDamage = reader.ReadInt32();
}
}
/// <summary>
/// Saves the data into the given <paramref name="stream"/>.
/// </summary>
/// <param name="stream">The <see cref="Stream"/> to save the data to.</param>
public override void Save(Stream stream)
{
using (BinaryDataWriter writer = new BinaryDataWriter(stream, Encoding.ASCII, true))
{
writer.Write(SpriteInactive);
writer.Write(SpriteActive);
writer.Write(DiseasePoints);
writer.Write(MaxDamage);
}
}
} }
} }

View File

@ -1,12 +1,6 @@
using System;
using System.IO;
using System.Text;
using Syroot.IO;
using Syroot.Worms.Core;
namespace Syroot.Worms.Gen2.Armageddon.ProjectX namespace Syroot.Worms.Gen2.Armageddon.ProjectX
{ {
public class DragonballStyle : StyleBase public class DragonballStyle : IStyle
{ {
// ---- PROPERTIES --------------------------------------------------------------------------------------------- // ---- PROPERTIES ---------------------------------------------------------------------------------------------
@ -23,43 +17,5 @@ namespace Syroot.Worms.Gen2.Armageddon.ProjectX
public int Force { get; set; } public int Force { get; set; }
public int BallTime { get; set; } public int BallTime { get; set; }
// ---- METHODS (PUBLIC) ---------------------------------------------------------------------------------------
/// <summary>
/// Loads the data from the given <see cref="Stream"/>.
/// </summary>
/// <param name="stream">The <see cref="Stream"/> to load the data from.</param>
public override void Load(Stream stream)
{
using (BinaryDataReader reader = new BinaryDataReader(stream, Encoding.ASCII, true))
{
FiringSound = reader.ReadInt32();
ImpactSound = reader.ReadInt32();
BallSprite = reader.ReadInt32();
Damage = reader.ReadInt32();
Angle = reader.ReadInt32();
Force = reader.ReadInt32();
BallTime = reader.ReadInt32();
}
}
/// <summary>
/// Saves the data into the given <paramref name="stream"/>.
/// </summary>
/// <param name="stream">The <see cref="Stream"/> to save the data to.</param>
public override void Save(Stream stream)
{
using (BinaryDataWriter writer = new BinaryDataWriter(stream, Encoding.ASCII, true))
{
writer.Write(FiringSound);
writer.Write(ImpactSound);
writer.Write(BallSprite);
writer.Write(Damage);
writer.Write(Angle);
writer.Write(Force);
writer.Write(BallTime);
}
}
} }
} }

View File

@ -1,10 +1,6 @@
using System.IO;
using System.Text;
using Syroot.IO;
namespace Syroot.Worms.Gen2.Armageddon.ProjectX namespace Syroot.Worms.Gen2.Armageddon.ProjectX
{ {
public class FirepunchStyle : StyleBase public class FirepunchStyle : IStyle
{ {
// ---- PROPERTIES --------------------------------------------------------------------------------------------- // ---- PROPERTIES ---------------------------------------------------------------------------------------------
@ -15,37 +11,5 @@ namespace Syroot.Worms.Gen2.Armageddon.ProjectX
public int PushPower { get; set; } public int PushPower { get; set; }
public int JumpHeight { get; set; } public int JumpHeight { get; set; }
// ---- METHODS (PUBLIC) ---------------------------------------------------------------------------------------
/// <summary>
/// Loads the data from the given <see cref="Stream"/>.
/// </summary>
/// <param name="stream">The <see cref="Stream"/> to load the data from.</param>
public override void Load(Stream stream)
{
using (BinaryDataReader reader = new BinaryDataReader(stream, Encoding.ASCII, true))
{
Damage = reader.ReadInt32();
Angle = reader.ReadInt32();
PushPower = reader.ReadInt32();
JumpHeight = reader.ReadInt32();
}
}
/// <summary>
/// Saves the data into the given <paramref name="stream"/>.
/// </summary>
/// <param name="stream">The <see cref="Stream"/> to save the data to.</param>
public override void Save(Stream stream)
{
using (BinaryDataWriter writer = new BinaryDataWriter(stream, Encoding.ASCII, true))
{
writer.Write(Damage);
writer.Write(Angle);
writer.Write(PushPower);
writer.Write(JumpHeight);
}
}
} }
} }

View File

@ -1,10 +1,8 @@
using System.IO; using Syroot.BinaryData;
using System.Text;
using Syroot.IO;
namespace Syroot.Worms.Gen2.Armageddon.ProjectX namespace Syroot.Worms.Gen2.Armageddon.ProjectX
{ {
public class FlamethrowerStyle : StyleBase public class FlamethrowerStyle : IStyle
{ {
// ---- PROPERTIES --------------------------------------------------------------------------------------------- // ---- PROPERTIES ---------------------------------------------------------------------------------------------
@ -16,40 +14,7 @@ namespace Syroot.Worms.Gen2.Armageddon.ProjectX
public int FireBurnTime { get; set; } public int FireBurnTime { get; set; }
[BinaryMember(BooleanFormat = BinaryBooleanFormat.NonZeroDword)]
public bool RemainOnTerrain { get; set; } public bool RemainOnTerrain { get; set; }
// ---- METHODS (PUBLIC) ---------------------------------------------------------------------------------------
/// <summary>
/// Loads the data from the given <see cref="Stream"/>.
/// </summary>
/// <param name="stream">The <see cref="Stream"/> to load the data from.</param>
public override void Load(Stream stream)
{
using (BinaryDataReader reader = new BinaryDataReader(stream, Encoding.ASCII, true))
{
FuelAmount = reader.ReadInt32();
FireIntensity = reader.ReadInt32();
FireAmount = reader.ReadInt32();
FireBurnTime = reader.ReadInt32();
RemainOnTerrain = reader.ReadBoolean(BinaryBooleanFormat.NonZeroDword);
}
}
/// <summary>
/// Saves the data into the given <paramref name="stream"/>.
/// </summary>
/// <param name="stream">The <see cref="Stream"/> to save the data to.</param>
public override void Save(Stream stream)
{
using (BinaryDataWriter writer = new BinaryDataWriter(stream, Encoding.ASCII, true))
{
writer.Write(FuelAmount);
writer.Write(FireIntensity);
writer.Write(FireAmount);
writer.Write(FireBurnTime);
writer.Write(RemainOnTerrain, BinaryBooleanFormat.NonZeroDword);
}
}
} }
} }

View File

@ -1,11 +1,6 @@
using System.IO;
using System.Text;
using Syroot.IO;
using Syroot.Worms.Core;
namespace Syroot.Worms.Gen2.Armageddon.ProjectX namespace Syroot.Worms.Gen2.Armageddon.ProjectX
{ {
public class GunStyle : StyleBase public class GunStyle : IStyle
{ {
// ---- PROPERTIES --------------------------------------------------------------------------------------------- // ---- PROPERTIES ---------------------------------------------------------------------------------------------
@ -36,57 +31,5 @@ namespace Syroot.Worms.Gen2.Armageddon.ProjectX
public int Range2 { get; set; } public int Range2 { get; set; }
public int Range3 { get; set; } public int Range3 { get; set; }
// ---- METHODS (PUBLIC) ---------------------------------------------------------------------------------------
/// <summary>
/// Loads the data from the given <see cref="Stream"/>.
/// </summary>
/// <param name="stream">The <see cref="Stream"/> to load the data from.</param>
public override void Load(Stream stream)
{
using (BinaryDataReader reader = new BinaryDataReader(stream, Encoding.ASCII, true))
{
BulletCount = reader.ReadInt32();
ReloadTime = reader.ReadInt32();
BulletSpread = reader.ReadInt32();
Burst = reader.ReadInt32();
BurstSpread = reader.ReadInt32();
Collisions = reader.ReadEnum<CollisionFlags>(false);
ExplosionBias = reader.ReadInt32();
ExplosionPower = reader.ReadInt32();
MaxDamage = reader.ReadInt32();
DamageSpread = reader.ReadInt32();
ExpEffect = reader.ReadInt32();
Range1 = reader.ReadInt32();
Range2 = reader.ReadInt32();
Range3 = reader.ReadInt32();
}
}
/// <summary>
/// Saves the data into the given <paramref name="stream"/>.
/// </summary>
/// <param name="stream">The <see cref="Stream"/> to save the data to.</param>
public override void Save(Stream stream)
{
using (BinaryDataWriter writer = new BinaryDataWriter(stream, Encoding.ASCII, true))
{
writer.Write(BulletCount);
writer.Write(ReloadTime);
writer.Write(BulletSpread);
writer.Write(Burst);
writer.Write(BurstSpread);
writer.Write(Collisions, true);
writer.Write(ExplosionBias);
writer.Write(ExplosionPower);
writer.Write(MaxDamage);
writer.Write(DamageSpread);
writer.Write(ExpEffect);
writer.Write(Range1);
writer.Write(Range2);
writer.Write(Range3);
}
}
} }
} }

View File

@ -0,0 +1,6 @@
namespace Syroot.Worms.Gen2.Armageddon.ProjectX
{
public interface IStyle
{
}
}

View File

@ -1,41 +1,9 @@
using System;
using System.IO;
using System.Text;
using Syroot.IO;
using Syroot.Worms.Core;
namespace Syroot.Worms.Gen2.Armageddon.ProjectX namespace Syroot.Worms.Gen2.Armageddon.ProjectX
{ {
public class JetpackStyle : StyleBase public class JetpackStyle : IStyle
{ {
// ---- PROPERTIES --------------------------------------------------------------------------------------------- // ---- PROPERTIES ---------------------------------------------------------------------------------------------
public int Fuel { get; set; } public int Fuel { get; set; }
// ---- METHODS (PUBLIC) ---------------------------------------------------------------------------------------
/// <summary>
/// Loads the data from the given <see cref="Stream"/>.
/// </summary>
/// <param name="stream">The <see cref="Stream"/> to load the data from.</param>
public override void Load(Stream stream)
{
using (BinaryDataReader reader = new BinaryDataReader(stream, Encoding.ASCII, true))
{
Fuel = reader.ReadInt32();
}
}
/// <summary>
/// Saves the data into the given <paramref name="stream"/>.
/// </summary>
/// <param name="stream">The <see cref="Stream"/> to save the data to.</param>
public override void Save(Stream stream)
{
using (BinaryDataWriter writer = new BinaryDataWriter(stream, Encoding.ASCII, true))
{
writer.Write(Fuel);
}
}
} }
} }

View File

@ -1,12 +1,6 @@
using System;
using System.IO;
using System.Text;
using Syroot.IO;
using Syroot.Worms.Core;
namespace Syroot.Worms.Gen2.Armageddon.ProjectX namespace Syroot.Worms.Gen2.Armageddon.ProjectX
{ {
public class KamikazeStyle : StyleBase public class KamikazeStyle : IStyle
{ {
// ---- PROPERTIES --------------------------------------------------------------------------------------------- // ---- PROPERTIES ---------------------------------------------------------------------------------------------
@ -21,41 +15,5 @@ namespace Syroot.Worms.Gen2.Armageddon.ProjectX
public int ImpactForce { get; set; } public int ImpactForce { get; set; }
public int ImpactAngle { get; set; } public int ImpactAngle { get; set; }
// ---- METHODS (PUBLIC) ---------------------------------------------------------------------------------------
/// <summary>
/// Loads the data from the given <see cref="Stream"/>.
/// </summary>
/// <param name="stream">The <see cref="Stream"/> to load the data from.</param>
public override void Load(Stream stream)
{
using (BinaryDataReader reader = new BinaryDataReader(stream, Encoding.ASCII, true))
{
FlyingTime = reader.ReadInt32();
ExplosionDamage = reader.ReadInt32();
FireSound = reader.ReadInt32();
Damage = reader.ReadInt32();
ImpactForce = reader.ReadInt32();
ImpactAngle = reader.ReadInt32();
}
}
/// <summary>
/// Saves the data into the given <paramref name="stream"/>.
/// </summary>
/// <param name="stream">The <see cref="Stream"/> to save the data to.</param>
public override void Save(Stream stream)
{
using (BinaryDataWriter writer = new BinaryDataWriter(stream, Encoding.ASCII, true))
{
writer.Write(FlyingTime);
writer.Write(ExplosionDamage);
writer.Write(FireSound);
writer.Write(Damage);
writer.Write(ImpactForce);
writer.Write(ImpactAngle);
}
}
} }
} }

View File

@ -1,12 +1,8 @@
using System; using Syroot.BinaryData;
using System.IO;
using System.Text;
using Syroot.IO;
using Syroot.Worms.Core;
namespace Syroot.Worms.Gen2.Armageddon.ProjectX namespace Syroot.Worms.Gen2.Armageddon.ProjectX
{ {
public class LauncherStyle : StyleBase public class LauncherStyle : IStyle
{ {
// ---- PROPERTIES --------------------------------------------------------------------------------------------- // ---- PROPERTIES ---------------------------------------------------------------------------------------------
@ -14,6 +10,7 @@ namespace Syroot.Worms.Gen2.Armageddon.ProjectX
public int FixedSpeed { get; set; } public int FixedSpeed { get; set; }
[BinaryMember(BooleanFormat = BinaryBooleanFormat.NonZeroDword)]
public bool RunAway { get; set; } public bool RunAway { get; set; }
public CollisionFlags Collisions { get; set; } public CollisionFlags Collisions { get; set; }
@ -44,120 +41,19 @@ namespace Syroot.Worms.Gen2.Armageddon.ProjectX
public Sound Sound { get; set; } public Sound Sound { get; set; }
[BinaryMember(BooleanFormat = BinaryBooleanFormat.NonZeroDword)]
public bool ExplodeOnSpace { get; set; } public bool ExplodeOnSpace { get; set; }
public ExplosionAction ExplosionAction { get; set; } public ExplosionAction ExplosionAction { get; set; }
public ActionBase Action { get; set; } [BinaryMember(Converter = typeof(ActionConverter))]
public IAction Action { get; set; }
[BinaryMember(OffsetOrigin = OffsetOrigin.Begin, Offset = 180)]
public ExplosionTarget ExplosionTarget { get; set; } public ExplosionTarget ExplosionTarget { get; set; }
public TargetBase Target { get; set; } [BinaryMember(Offset = sizeof(int), Converter = typeof(TargetConverter))]
public ITarget Target { get; set; }
// ---- METHODS (PUBLIC) ---------------------------------------------------------------------------------------
/// <summary>
/// Loads the data from the given <see cref="Stream"/>.
/// </summary>
/// <param name="stream">The <see cref="Stream"/> to load the data from.</param>
public override void Load(Stream stream)
{
using (BinaryDataReader reader = new BinaryDataReader(stream, Encoding.ASCII, true))
{
long offset = reader.Position;
SpriteSize = reader.ReadInt32();
FixedSpeed = reader.ReadInt32();
RunAway = reader.ReadBoolean(BinaryBooleanFormat.NonZeroDword);
Collisions = reader.ReadEnum<CollisionFlags>(false);
ExplosionBias = reader.ReadInt32();
ExplosionPushPower = reader.ReadInt32();
ExplosionDamage = reader.ReadInt32();
ExplosionDamageVariation = reader.ReadInt32();
ExplosionUnknown = reader.ReadInt32();
Sprite = reader.ReadStruct<Sprite>();
VariableSpeed = reader.ReadInt32();
WindFactor = reader.ReadInt32();
MotionRandomness = reader.ReadInt32();
GravityFactor = reader.ReadInt32();
ExplosionCountdown = reader.ReadInt32();
ExplosionTimer = reader.ReadInt32();
Sound = reader.ReadStruct<Sound>();
ExplodeOnSpace = reader.ReadBoolean(BinaryBooleanFormat.NonZeroDword);
ExplosionAction = reader.ReadEnum<ExplosionAction>(false);
switch (ExplosionAction)
{
case ExplosionAction.Bounce:
Action = reader.Load<BounceAction>();
break;
case ExplosionAction.Dig:
Action = reader.Load<DigAction>();
break;
case ExplosionAction.Home:
Action = reader.Load<HomeAction>();
break;
case ExplosionAction.Roam:
Action = reader.Load<RoamAction>();
break;
}
reader.Position = offset + 180;
ExplosionTarget = reader.ReadEnum<ExplosionTarget>(false);
reader.Seek(sizeof(int));
switch (ExplosionTarget)
{
case ExplosionTarget.Clusters:
Target = reader.Load<ClusterTarget>();
break;
case ExplosionTarget.Fire:
Target = reader.Load<FireTarget>();
break;
}
}
}
/// <summary>
/// Saves the data into the given <paramref name="stream"/>.
/// </summary>
/// <param name="stream">The <see cref="Stream"/> to save the data to.</param>
public override void Save(Stream stream)
{
using (BinaryDataWriter writer = new BinaryDataWriter(stream, Encoding.ASCII, true))
{
long offset = writer.Position;
writer.Write(SpriteSize);
writer.Write(FixedSpeed);
writer.Write(RunAway, BinaryBooleanFormat.NonZeroDword);
writer.Write(Collisions, true);
writer.Write(ExplosionBias);
writer.Write(ExplosionPushPower);
writer.Write(ExplosionDamage);
writer.Write(ExplosionDamageVariation);
writer.Write(ExplosionUnknown);
writer.Write(Sprite);
writer.Write(VariableSpeed);
writer.Write(WindFactor);
writer.Write(MotionRandomness);
writer.Write(GravityFactor);
writer.Write(ExplosionCountdown);
writer.Write(ExplosionTimer);
writer.Write(Sound);
writer.Write(ExplodeOnSpace, BinaryBooleanFormat.NonZeroDword);
writer.Write(ExplosionAction, true);
writer.Save(Action);
writer.Position = offset + 180;
writer.Write(ExplosionTarget, true);
writer.Seek(sizeof(int));
if (ExplosionTarget != ExplosionTarget.None)
{
writer.Save(Target);
}
}
}
} }
public enum ExplosionAction : int public enum ExplosionAction : int

View File

@ -1,40 +1,9 @@
using System.IO;
using System.Text;
using Syroot.IO;
using Syroot.Worms.Core;
namespace Syroot.Worms.Gen2.Armageddon.ProjectX namespace Syroot.Worms.Gen2.Armageddon.ProjectX
{ {
public class MineStyle : StyleBase public class MineStyle : IStyle
{ {
// ---- PROPERTIES --------------------------------------------------------------------------------------------- // ---- PROPERTIES ---------------------------------------------------------------------------------------------
public Mine Mine; public Mine Mine;
// ---- METHODS (PUBLIC) ---------------------------------------------------------------------------------------
/// <summary>
/// Loads the data from the given <see cref="Stream"/>.
/// </summary>
/// <param name="stream">The <see cref="Stream"/> to load the data from.</param>
public override void Load(Stream stream)
{
using (BinaryDataReader reader = new BinaryDataReader(stream, Encoding.ASCII, true))
{
Mine = reader.ReadStruct<Mine>();
}
}
/// <summary>
/// Saves the data into the given <paramref name="stream"/>.
/// </summary>
/// <param name="stream">The <see cref="Stream"/> to save the data to.</param>
public override void Save(Stream stream)
{
using (BinaryDataWriter writer = new BinaryDataWriter(stream, Encoding.ASCII, true))
{
writer.Write(Mine);
}
}
} }
} }

View File

@ -1,12 +1,6 @@
using System;
using System.IO;
using System.Text;
using Syroot.IO;
using Syroot.Worms.Core;
namespace Syroot.Worms.Gen2.Armageddon.ProjectX namespace Syroot.Worms.Gen2.Armageddon.ProjectX
{ {
public class NinjaRopeStyle : StyleBase public class NinjaRopeStyle : IStyle
{ {
// ---- PROPERTIES --------------------------------------------------------------------------------------------- // ---- PROPERTIES ---------------------------------------------------------------------------------------------
@ -15,35 +9,5 @@ namespace Syroot.Worms.Gen2.Armageddon.ProjectX
public int Length { get; set; } public int Length { get; set; }
public int AngleRestriction { get; set; } public int AngleRestriction { get; set; }
// ---- METHODS (PUBLIC) ---------------------------------------------------------------------------------------
/// <summary>
/// Loads the data from the given <see cref="Stream"/>.
/// </summary>
/// <param name="stream">The <see cref="Stream"/> to load the data from.</param>
public override void Load(Stream stream)
{
using (BinaryDataReader reader = new BinaryDataReader(stream, Encoding.ASCII, true))
{
ShotCount = reader.ReadInt32();
Length = reader.ReadInt32();
AngleRestriction = reader.ReadInt32();
}
}
/// <summary>
/// Saves the data into the given <paramref name="stream"/>.
/// </summary>
/// <param name="stream">The <see cref="Stream"/> to save the data to.</param>
public override void Save(Stream stream)
{
using (BinaryDataWriter writer = new BinaryDataWriter(stream, Encoding.ASCII, true))
{
writer.Write(ShotCount);
writer.Write(Length);
writer.Write(AngleRestriction);
}
}
} }
} }

View File

@ -1,45 +1,11 @@
using System;
using System.IO;
using System.Text;
using Syroot.IO;
using Syroot.Worms.Core;
namespace Syroot.Worms.Gen2.Armageddon.ProjectX namespace Syroot.Worms.Gen2.Armageddon.ProjectX
{ {
public class NuclearTestStyle : StyleBase public class NuclearTestStyle : IStyle
{ {
// ---- PROPERTIES --------------------------------------------------------------------------------------------- // ---- PROPERTIES ---------------------------------------------------------------------------------------------
public int WaterRise { get; set; } public int WaterRise { get; set; }
public int DiseasePoints { get; set; } public int DiseasePoints { get; set; }
// ---- METHODS (PUBLIC) ---------------------------------------------------------------------------------------
/// <summary>
/// Loads the data from the given <see cref="Stream"/>.
/// </summary>
/// <param name="stream">The <see cref="Stream"/> to load the data from.</param>
public override void Load(Stream stream)
{
using (BinaryDataReader reader = new BinaryDataReader(stream, Encoding.ASCII, true))
{
WaterRise = reader.ReadInt32();
DiseasePoints = reader.ReadInt32();
}
}
/// <summary>
/// Saves the data into the given <paramref name="stream"/>.
/// </summary>
/// <param name="stream">The <see cref="Stream"/> to save the data to.</param>
public override void Save(Stream stream)
{
using (BinaryDataWriter writer = new BinaryDataWriter(stream, Encoding.ASCII, true))
{
writer.Write(WaterRise);
writer.Write(DiseasePoints);
}
}
} }
} }

View File

@ -1,41 +1,9 @@
using System;
using System.IO;
using System.Text;
using Syroot.IO;
using Syroot.Worms.Core;
namespace Syroot.Worms.Gen2.Armageddon.ProjectX namespace Syroot.Worms.Gen2.Armageddon.ProjectX
{ {
public class ParachuteStyle : StyleBase public class ParachuteStyle : IStyle
{ {
// ---- PROPERTIES --------------------------------------------------------------------------------------------- // ---- PROPERTIES ---------------------------------------------------------------------------------------------
public int WindResponse { get; set; } public int WindResponse { get; set; }
// ---- METHODS (PUBLIC) ---------------------------------------------------------------------------------------
/// <summary>
/// Loads the data from the given <see cref="Stream"/>.
/// </summary>
/// <param name="stream">The <see cref="Stream"/> to load the data from.</param>
public override void Load(Stream stream)
{
using (BinaryDataReader reader = new BinaryDataReader(stream, Encoding.ASCII, true))
{
WindResponse = reader.ReadInt32();
}
}
/// <summary>
/// Saves the data into the given <paramref name="stream"/>.
/// </summary>
/// <param name="stream">The <see cref="Stream"/> to save the data to.</param>
public override void Save(Stream stream)
{
using (BinaryDataWriter writer = new BinaryDataWriter(stream, Encoding.ASCII, true))
{
writer.Write(WindResponse);
}
}
} }
} }

View File

@ -1,12 +1,6 @@
using System;
using System.IO;
using System.Text;
using Syroot.IO;
using Syroot.Worms.Core;
namespace Syroot.Worms.Gen2.Armageddon.ProjectX namespace Syroot.Worms.Gen2.Armageddon.ProjectX
{ {
public class PneumaticDrillStyle : StyleBase public class PneumaticDrillStyle : IStyle
{ {
// ---- PROPERTIES --------------------------------------------------------------------------------------------- // ---- PROPERTIES ---------------------------------------------------------------------------------------------
@ -17,37 +11,5 @@ namespace Syroot.Worms.Gen2.Armageddon.ProjectX
public int ImpactAngle { get; set; } public int ImpactAngle { get; set; }
public int TunellingTime { get; set; } public int TunellingTime { get; set; }
// ---- METHODS (PUBLIC) ---------------------------------------------------------------------------------------
/// <summary>
/// Loads the data from the given <see cref="Stream"/>.
/// </summary>
/// <param name="stream">The <see cref="Stream"/> to load the data from.</param>
public override void Load(Stream stream)
{
using (BinaryDataReader reader = new BinaryDataReader(stream, Encoding.ASCII, true))
{
Damage = reader.ReadInt32();
PushPower = reader.ReadInt32();
ImpactAngle = reader.ReadInt32();
TunellingTime = reader.ReadInt32();
}
}
/// <summary>
/// Saves the data into the given <paramref name="stream"/>.
/// </summary>
/// <param name="stream">The <see cref="Stream"/> to save the data to.</param>
public override void Save(Stream stream)
{
using (BinaryDataWriter writer = new BinaryDataWriter(stream, Encoding.ASCII, true))
{
writer.Write(Damage);
writer.Write(PushPower);
writer.Write(ImpactAngle);
writer.Write(TunellingTime);
}
}
} }
} }

View File

@ -1,12 +1,6 @@
using System;
using System.IO;
using System.Text;
using Syroot.IO;
using Syroot.Worms.Core;
namespace Syroot.Worms.Gen2.Armageddon.ProjectX namespace Syroot.Worms.Gen2.Armageddon.ProjectX
{ {
public class ProdStyle : StyleBase public class ProdStyle : IStyle
{ {
// ---- PROPERTIES --------------------------------------------------------------------------------------------- // ---- PROPERTIES ---------------------------------------------------------------------------------------------
@ -15,35 +9,5 @@ namespace Syroot.Worms.Gen2.Armageddon.ProjectX
public int Force { get; set; } public int Force { get; set; }
public int Angle { get; set; } public int Angle { get; set; }
// ---- METHODS (PUBLIC) ---------------------------------------------------------------------------------------
/// <summary>
/// Loads the data from the given <see cref="Stream"/>.
/// </summary>
/// <param name="stream">The <see cref="Stream"/> to load the data from.</param>
public override void Load(Stream stream)
{
using (BinaryDataReader reader = new BinaryDataReader(stream, Encoding.ASCII, true))
{
Damage = reader.ReadInt32();
Force = reader.ReadInt32();
Angle = reader.ReadInt32();
}
}
/// <summary>
/// Saves the data into the given <paramref name="stream"/>.
/// </summary>
/// <param name="stream">The <see cref="Stream"/> to save the data to.</param>
public override void Save(Stream stream)
{
using (BinaryDataWriter writer = new BinaryDataWriter(stream, Encoding.ASCII, true))
{
writer.Write(Damage);
writer.Write(Force);
writer.Write(Angle);
}
}
} }
} }

View File

@ -1,17 +0,0 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Syroot.Worms.Core;
namespace Syroot.Worms.Gen2.Armageddon.ProjectX
{
public abstract class StyleBase : ILoadable, ISaveable
{
public abstract void Load(Stream stream);
public abstract void Save(Stream stream);
}
}

View File

@ -1,45 +1,11 @@
using System;
using System.IO;
using System.Text;
using Syroot.IO;
using Syroot.Worms.Core;
namespace Syroot.Worms.Gen2.Armageddon.ProjectX namespace Syroot.Worms.Gen2.Armageddon.ProjectX
{ {
public class SuicideBomberStyle : StyleBase public class SuicideBomberStyle : IStyle
{ {
// ---- PROPERTIES --------------------------------------------------------------------------------------------- // ---- PROPERTIES ---------------------------------------------------------------------------------------------
public int DiseasePoints { get; set; } public int DiseasePoints { get; set; }
public int Damage { get; set; } public int Damage { get; set; }
// ---- METHODS (PUBLIC) ---------------------------------------------------------------------------------------
/// <summary>
/// Loads the data from the given <see cref="Stream"/>.
/// </summary>
/// <param name="stream">The <see cref="Stream"/> to load the data from.</param>
public override void Load(Stream stream)
{
using (BinaryDataReader reader = new BinaryDataReader(stream, Encoding.ASCII, true))
{
DiseasePoints = reader.ReadInt32();
Damage = reader.ReadInt32();
}
}
/// <summary>
/// Saves the data into the given <paramref name="stream"/>.
/// </summary>
/// <param name="stream">The <see cref="Stream"/> to save the data to.</param>
public override void Save(Stream stream)
{
using (BinaryDataWriter writer = new BinaryDataWriter(stream, Encoding.ASCII, true))
{
writer.Write(DiseasePoints);
writer.Write(Damage);
}
}
} }
} }

View File

@ -1,11 +1,8 @@
using System.IO; using Syroot.BinaryData;
using System.Text;
using Syroot.IO;
using Syroot.Worms.Core;
namespace Syroot.Worms.Gen2.Armageddon.ProjectX namespace Syroot.Worms.Gen2.Armageddon.ProjectX
{ {
public class ClusterTarget : TargetBase public class ClusterTarget : ITarget
{ {
// ---- PROPERTIES --------------------------------------------------------------------------------------------- // ---- PROPERTIES ---------------------------------------------------------------------------------------------
@ -47,94 +44,12 @@ namespace Syroot.Worms.Gen2.Armageddon.ProjectX
public Sound Sound { get; set; } public Sound Sound { get; set; }
[BinaryMember(BooleanFormat = BinaryBooleanFormat.NonZeroDword)]
public bool ExplodeOnSpace { get; set; } public bool ExplodeOnSpace { get; set; }
public ExplosionAction ExplosionAction { get; set; } public ExplosionAction ExplosionAction { get; set; }
public ActionBase Action { get; set; } [BinaryMember(Converter = typeof(ActionConverter))]
public IAction Action { get; set; }
// ---- METHODS (PUBLIC) ---------------------------------------------------------------------------------------
/// <summary>
/// Loads the data from the given <see cref="Stream"/>.
/// </summary>
/// <param name="stream">The <see cref="Stream"/> to load the data from.</param>
public override void Load(Stream stream)
{
using (BinaryDataReader reader = new BinaryDataReader(stream, Encoding.ASCII, true))
{
ClusterCount = reader.ReadInt32();
DispersionPower = reader.ReadInt32();
Speed = reader.ReadInt32();
EjectionAngle = reader.ReadInt32();
DispersionAngle = reader.ReadInt32();
Collisions = reader.ReadEnum<CollisionFlags>(false);
ExplosionBias = reader.ReadInt32();
ExplosionPushPower = reader.ReadInt32();
ExplosionDamage = reader.ReadInt32();
ExplosionDamageVariation = reader.ReadInt32();
SpriteCount = reader.ReadInt32();
Sprite = reader.ReadStruct<Sprite>();
Acceleration = reader.ReadInt32();
WindResponse = reader.ReadInt32();
MotionRandomness = reader.ReadInt32();
GravityFactor = reader.ReadInt32();
Unused1 = reader.ReadInt32();
Unused2 = reader.ReadInt32();
Sound = reader.ReadStruct<Sound>();
ExplodeOnSpace = reader.ReadBoolean(BinaryBooleanFormat.NonZeroDword);
ExplosionAction = reader.ReadEnum<ExplosionAction>(false);
switch (ExplosionAction)
{
case ExplosionAction.Bounce:
Action = reader.Load<BounceAction>();
break;
case ExplosionAction.Dig:
Action = reader.Load<DigAction>();
break;
case ExplosionAction.Home:
Action = reader.Load<HomeAction>();
break;
case ExplosionAction.Roam:
Action = reader.Load<RoamAction>();
break;
}
}
}
/// <summary>
/// Saves the data into the given <paramref name="stream"/>.
/// </summary>
/// <param name="stream">The <see cref="Stream"/> to save the data to.</param>
public override void Save(Stream stream)
{
using (BinaryDataWriter writer = new BinaryDataWriter(stream, Encoding.ASCII, true))
{
writer.Write(ClusterCount);
writer.Write(DispersionPower);
writer.Write(Speed);
writer.Write(EjectionAngle);
writer.Write(DispersionAngle);
writer.Write(Collisions, true);
writer.Write(ExplosionBias);
writer.Write(ExplosionPushPower);
writer.Write(ExplosionDamage);
writer.Write(ExplosionDamageVariation);
writer.Write(SpriteCount);
writer.Write(Sprite);
writer.Write(Acceleration);
writer.Write(WindResponse);
writer.Write(MotionRandomness);
writer.Write(GravityFactor);
writer.Write(Unused1);
writer.Write(Unused2);
writer.Write(Sound);
writer.Write(ExplodeOnSpace, BinaryBooleanFormat.NonZeroDword);
writer.Write(ExplosionAction, true);
writer.Save(Action);
}
}
} }
} }

View File

@ -1,10 +1,8 @@
using System.IO; using Syroot.BinaryData;
using System.Text;
using Syroot.IO;
namespace Syroot.Worms.Gen2.Armageddon.ProjectX namespace Syroot.Worms.Gen2.Armageddon.ProjectX
{ {
public class FireTarget : TargetBase public class FireTarget : ITarget
{ {
// ---- PROPERTIES --------------------------------------------------------------------------------------------- // ---- PROPERTIES ---------------------------------------------------------------------------------------------
@ -14,38 +12,7 @@ namespace Syroot.Worms.Gen2.Armageddon.ProjectX
public int Time { get; set; } public int Time { get; set; }
[BinaryMember(BooleanFormat = BinaryBooleanFormat.NonZeroDword)]
public bool StayBetweenTurns { get; set; } public bool StayBetweenTurns { get; set; }
// ---- METHODS (PUBLIC) ---------------------------------------------------------------------------------------
/// <summary>
/// Loads the data from the given <see cref="Stream"/>.
/// </summary>
/// <param name="stream">The <see cref="Stream"/> to load the data from.</param>
public override void Load(Stream stream)
{
using (BinaryDataReader reader = new BinaryDataReader(stream, Encoding.ASCII, true))
{
Power = reader.ReadInt32();
Spread = reader.ReadInt32();
Time = reader.ReadInt32();
StayBetweenTurns = reader.ReadBoolean(BinaryBooleanFormat.NonZeroDword);
}
}
/// <summary>
/// Saves the data into the given <paramref name="stream"/>.
/// </summary>
/// <param name="stream">The <see cref="Stream"/> to save the data to.</param>
public override void Save(Stream stream)
{
using (BinaryDataWriter writer = new BinaryDataWriter(stream, Encoding.ASCII, true))
{
writer.Write(Power);
writer.Write(Spread);
writer.Write(Time);
writer.Write(StayBetweenTurns, BinaryBooleanFormat.NonZeroDword);
}
}
} }
} }

View File

@ -0,0 +1,6 @@
namespace Syroot.Worms.Gen2.Armageddon.ProjectX
{
public interface ITarget
{
}
}

View File

@ -1,22 +0,0 @@
using System.IO;
using Syroot.Worms.Core;
namespace Syroot.Worms.Gen2.Armageddon.ProjectX
{
public abstract class TargetBase : ILoadable, ISaveable
{
// ---- METHODS (PUBLIC) ---------------------------------------------------------------------------------------
/// <summary>
/// Loads the data from the given <see cref="Stream"/>.
/// </summary>
/// <param name="stream">The <see cref="Stream"/> to load the data from.</param>
public abstract void Load(Stream stream);
/// <summary>
/// Saves the data into the given <paramref name="stream"/>.
/// </summary>
/// <param name="stream">The <see cref="Stream"/> to save the data to.</param>
public abstract void Save(Stream stream);
}
}

View File

@ -0,0 +1,37 @@
using System;
using Syroot.BinaryData;
namespace Syroot.Worms.Gen2.Armageddon.ProjectX
{
internal class TargetConverter : IBinaryConverter
{
// ---- METHODS (PUBLIC) ---------------------------------------------------------------------------------------
public object Read(BinaryDataReader reader, object instance, BinaryMemberAttribute memberAttribute)
{
ExplosionTarget explosionTarget;
switch (instance)
{
case LauncherStyle launcherStyle:
explosionTarget = launcherStyle.ExplosionTarget;
break;
default:
throw new NotImplementedException();
}
switch (explosionTarget)
{
case ExplosionTarget.Clusters:
return reader.ReadObject<ClusterTarget>();
case ExplosionTarget.Fire:
return reader.ReadObject<FireTarget>();
}
return null;
}
public void Write(BinaryDataWriter writer, object instance, BinaryMemberAttribute memberAttribute, object value)
{
writer.WriteObject(value);
}
}
}

View File

@ -1,7 +1,7 @@
using System.Diagnostics; using System.Diagnostics;
using System.IO; using System.IO;
using System.Text; using System.Text;
using Syroot.IO; using Syroot.BinaryData;
using Syroot.Worms.Core; using Syroot.Worms.Core;
namespace Syroot.Worms.Gen2.Armageddon.ProjectX namespace Syroot.Worms.Gen2.Armageddon.ProjectX
@ -37,6 +37,8 @@ namespace Syroot.Worms.Gen2.Armageddon.ProjectX
public WeaponActivation Activation { get; set; } public WeaponActivation Activation { get; set; }
public int NotUsed { get; set; }
public int ThrowHerdCount { get; set; } public int ThrowHerdCount { get; set; }
public int AirstrikeSubtype { get; set; } public int AirstrikeSubtype { get; set; }
@ -47,7 +49,7 @@ namespace Syroot.Worms.Gen2.Armageddon.ProjectX
public WeaponThrowAction ThrowAction { get; set; } public WeaponThrowAction ThrowAction { get; set; }
public StyleBase Style { get; set; } public IStyle Style { get; set; }
public bool AmmunitionOverride { get; set; } public bool AmmunitionOverride { get; set; }
@ -136,24 +138,24 @@ namespace Syroot.Worms.Gen2.Armageddon.ProjectX
{ {
case WeaponActivation.Airstrike: case WeaponActivation.Airstrike:
AirstrikeSubtype = reader.ReadInt32(); AirstrikeSubtype = reader.ReadInt32();
Style = reader.Load<AirstrikeStyle>(); Style = reader.ReadObject<AirstrikeStyle>();
break; break;
case WeaponActivation.Crosshair: case WeaponActivation.Crosshair:
reader.Seek(sizeof(int)); NotUsed = reader.ReadInt32();
CrosshairAction = reader.ReadEnum<WeaponCrosshairAction>(false); CrosshairAction = reader.ReadEnum<WeaponCrosshairAction>(false);
switch (CrosshairAction) switch (CrosshairAction)
{ {
case WeaponCrosshairAction.Bow: case WeaponCrosshairAction.Bow:
Style = reader.Load<BowStyle>(); Style = reader.ReadObject<BowStyle>();
break; break;
case WeaponCrosshairAction.Flamethrower: case WeaponCrosshairAction.Flamethrower:
Style = reader.Load<FlamethrowerStyle>(); Style = reader.ReadObject<FlamethrowerStyle>();
break; break;
case WeaponCrosshairAction.Gun: case WeaponCrosshairAction.Gun:
Style = reader.Load<GunStyle>(); Style = reader.ReadObject<GunStyle>();
break; break;
case WeaponCrosshairAction.Launcher: case WeaponCrosshairAction.Launcher:
Style = reader.Load<LauncherStyle>(); Style = reader.ReadObject<LauncherStyle>();
break; break;
} }
break; break;
@ -162,46 +164,46 @@ namespace Syroot.Worms.Gen2.Armageddon.ProjectX
switch (SpacebarAction) switch (SpacebarAction)
{ {
case WeaponSpacebarAction.Armageddon: case WeaponSpacebarAction.Armageddon:
Style = reader.Load<LauncherStyle>(); Style = reader.ReadObject<LauncherStyle>();
break; break;
case WeaponSpacebarAction.BaseballBat: case WeaponSpacebarAction.BaseballBat:
Style = reader.Load<BaseballBatStyle>(); Style = reader.ReadObject<BaseballBatStyle>();
break; break;
case WeaponSpacebarAction.BattleAxe: case WeaponSpacebarAction.BattleAxe:
Style = reader.Load<BattleAxeStyle>(); Style = reader.ReadObject<BattleAxeStyle>();
break; break;
case WeaponSpacebarAction.Blowtorch: case WeaponSpacebarAction.Blowtorch:
Style = reader.Load<BlowtorchStyle>(); Style = reader.ReadObject<BlowtorchStyle>();
break; break;
case WeaponSpacebarAction.Dragonball: case WeaponSpacebarAction.Dragonball:
Style = reader.Load<DragonballStyle>(); Style = reader.ReadObject<DragonballStyle>();
break; break;
case WeaponSpacebarAction.Firepunch: case WeaponSpacebarAction.Firepunch:
Style = reader.Load<FirepunchStyle>(); Style = reader.ReadObject<FirepunchStyle>();
break; break;
case WeaponSpacebarAction.Jetpack: case WeaponSpacebarAction.Jetpack:
Style = reader.Load<JetpackStyle>(); Style = reader.ReadObject<JetpackStyle>();
break; break;
case WeaponSpacebarAction.Kamikaze: case WeaponSpacebarAction.Kamikaze:
Style = reader.Load<KamikazeStyle>(); Style = reader.ReadObject<KamikazeStyle>();
break; break;
case WeaponSpacebarAction.NinjaRope: case WeaponSpacebarAction.NinjaRope:
Style = reader.Load<NinjaRopeStyle>(); Style = reader.ReadObject<NinjaRopeStyle>();
break; break;
case WeaponSpacebarAction.NuclearTest: case WeaponSpacebarAction.NuclearTest:
Style = reader.Load<NuclearTestStyle>(); Style = reader.ReadObject<NuclearTestStyle>();
break; break;
case WeaponSpacebarAction.Parachute: case WeaponSpacebarAction.Parachute:
Style = reader.Load<ParachuteStyle>(); Style = reader.ReadObject<ParachuteStyle>();
break; break;
case WeaponSpacebarAction.PneumaticDrill: case WeaponSpacebarAction.PneumaticDrill:
Style = reader.Load<PneumaticDrillStyle>(); Style = reader.ReadObject<PneumaticDrillStyle>();
break; break;
case WeaponSpacebarAction.Prod: case WeaponSpacebarAction.Prod:
Style = reader.Load<ProdStyle>(); Style = reader.ReadObject<ProdStyle>();
break; break;
case WeaponSpacebarAction.SuicideBomber: case WeaponSpacebarAction.SuicideBomber:
Style = reader.Load<SuicideBomberStyle>(); Style = reader.ReadObject<SuicideBomberStyle>();
break; break;
case WeaponSpacebarAction.Bungee: case WeaponSpacebarAction.Bungee:
case WeaponSpacebarAction.Earthquake: case WeaponSpacebarAction.Earthquake:
@ -223,13 +225,13 @@ namespace Syroot.Worms.Gen2.Armageddon.ProjectX
switch (ThrowAction) switch (ThrowAction)
{ {
case WeaponThrowAction.Canister: case WeaponThrowAction.Canister:
Style = reader.Load<CanisterStyle>(); Style = reader.ReadObject<CanisterStyle>();
break; break;
case WeaponThrowAction.Launcher: case WeaponThrowAction.Launcher:
Style = reader.Load<LauncherStyle>(); Style = reader.ReadObject<LauncherStyle>();
break; break;
case WeaponThrowAction.Mine: case WeaponThrowAction.Mine:
Style = reader.Load<MineStyle>(); Style = reader.ReadObject<MineStyle>();
break; break;
} }
break; break;
@ -306,14 +308,14 @@ namespace Syroot.Worms.Gen2.Armageddon.ProjectX
{ {
case WeaponActivation.Airstrike: case WeaponActivation.Airstrike:
writer.Write(AirstrikeSubtype); writer.Write(AirstrikeSubtype);
writer.Save(Style); writer.WriteObject(Style);
break; break;
case WeaponActivation.Crosshair: case WeaponActivation.Crosshair:
writer.Seek(sizeof(int)); writer.Write(NotUsed);
writer.Write(CrosshairAction, true); writer.Write(CrosshairAction, true);
if (CrosshairAction != WeaponCrosshairAction.None) if (CrosshairAction != WeaponCrosshairAction.None)
{ {
writer.Save(Style); writer.WriteObject(Style);
} }
break; break;
case WeaponActivation.Spacebar: case WeaponActivation.Spacebar:
@ -334,7 +336,7 @@ namespace Syroot.Worms.Gen2.Armageddon.ProjectX
case WeaponSpacebarAction.PneumaticDrill: case WeaponSpacebarAction.PneumaticDrill:
case WeaponSpacebarAction.Prod: case WeaponSpacebarAction.Prod:
case WeaponSpacebarAction.SuicideBomber: case WeaponSpacebarAction.SuicideBomber:
writer.Save(Style); writer.WriteObject(Style);
break; break;
} }
break; break;
@ -343,7 +345,7 @@ namespace Syroot.Worms.Gen2.Armageddon.ProjectX
writer.Write(ThrowAction, true); writer.Write(ThrowAction, true);
if (ThrowAction != WeaponThrowAction.None) if (ThrowAction != WeaponThrowAction.None)
{ {
writer.Save(Style); writer.WriteObject(Style);
} }
break; break;
} }

View File

@ -2,7 +2,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Text; using System.Text;
using Syroot.IO; using Syroot.BinaryData;
using Syroot.Worms.Core; using Syroot.Worms.Core;
namespace Syroot.Worms.Gen2.Armageddon namespace Syroot.Worms.Gen2.Armageddon

View File

@ -1,7 +1,7 @@
using System.Diagnostics; using System.Diagnostics;
using System.IO; using System.IO;
using System.Text; using System.Text;
using Syroot.IO; using Syroot.BinaryData;
using Syroot.Maths; using Syroot.Maths;
using Syroot.Worms.Core; using Syroot.Worms.Core;

View File

@ -2,7 +2,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Text; using System.Text;
using Syroot.IO; using Syroot.BinaryData;
using Syroot.Worms.Core; using Syroot.Worms.Core;
namespace Syroot.Worms.Gen2.Armageddon namespace Syroot.Worms.Gen2.Armageddon

View File

@ -1,7 +1,7 @@
using System; using System;
using System.IO; using System.IO;
using System.Text; using System.Text;
using Syroot.IO; using Syroot.BinaryData;
using Syroot.Maths; using Syroot.Maths;
using Syroot.Worms.Core; using Syroot.Worms.Core;

View File

@ -1,5 +1,5 @@
using System.IO; using System.IO;
using Syroot.IO; using Syroot.BinaryData;
using Syroot.Maths; using Syroot.Maths;
using Syroot.Worms.Core; using Syroot.Worms.Core;

View File

@ -1,7 +1,7 @@
using System; using System;
using System.IO; using System.IO;
using System.Text; using System.Text;
using Syroot.IO; using Syroot.BinaryData;
using Syroot.Maths; using Syroot.Maths;
using Syroot.Worms.Core; using Syroot.Worms.Core;

View File

@ -1,7 +1,7 @@
using System.Diagnostics; using System.Diagnostics;
using System.IO; using System.IO;
using System.Text; using System.Text;
using Syroot.IO; using Syroot.BinaryData;
using Syroot.Maths; using Syroot.Maths;
using Syroot.Worms.Core; using Syroot.Worms.Core;

View File

@ -2,7 +2,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Text; using System.Text;
using Syroot.IO; using Syroot.BinaryData;
using Syroot.Worms.Core; using Syroot.Worms.Core;
namespace Syroot.Worms.Gen2.WorldParty namespace Syroot.Worms.Gen2.WorldParty

View File

@ -1,6 +1,6 @@
using System.IO; using System.IO;
using System.Text; using System.Text;
using Syroot.IO; using Syroot.BinaryData;
using Syroot.Maths; using Syroot.Maths;
using Syroot.Worms.Core; using Syroot.Worms.Core;

View File

@ -1,6 +1,6 @@
using System.IO; using System.IO;
using System.Text; using System.Text;
using Syroot.IO; using Syroot.BinaryData;
using Syroot.Worms.Core; using Syroot.Worms.Core;
namespace Syroot.Worms.Gen2.Worms2 namespace Syroot.Worms.Gen2.Worms2

View File

@ -1,6 +1,6 @@
using System.IO; using System.IO;
using System.Text; using System.Text;
using Syroot.IO; using Syroot.BinaryData;
using Syroot.Worms.Core; using Syroot.Worms.Core;
namespace Syroot.Worms.Gen2.Worms2 namespace Syroot.Worms.Gen2.Worms2

View File

@ -1,7 +1,7 @@
using System; using System;
using System.IO; using System.IO;
using System.Text; using System.Text;
using Syroot.IO; using Syroot.BinaryData;
using Syroot.Worms.Core; using Syroot.Worms.Core;
namespace Syroot.Worms.Gen2.Worms2 namespace Syroot.Worms.Gen2.Worms2

View File

@ -1,7 +1,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Text; using System.Text;
using Syroot.IO; using Syroot.BinaryData;
using Syroot.Worms.Core; using Syroot.Worms.Core;
namespace Syroot.Worms.Gen2.Worms2 namespace Syroot.Worms.Gen2.Worms2

View File

@ -22,7 +22,7 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="ImageSharp" Version="1.0.0-alpha7-00006" /> <PackageReference Include="ImageSharp" Version="1.0.0-alpha7-00006" />
<PackageReference Include="Syroot.IO.BinaryData" Version="1.3.0" /> <PackageReference Include="Syroot.IO.BinaryData" Version="2.0.0-rc1" />
<PackageReference Include="Syroot.Maths" Version="1.3.1" /> <PackageReference Include="Syroot.Maths" Version="1.3.1" />
</ItemGroup> </ItemGroup>