Replace all inherited interface XML summaries with inheritdoc marker.

This commit is contained in:
Ray Koopa 2020-06-27 16:35:11 +02:00
parent 88d07a1ff1
commit ad2a7c79e1
17 changed files with 411 additions and 573 deletions

View File

@ -58,10 +58,7 @@ namespace Syroot.Worms.Armageddon.ProjectX
// ---- METHODS (PUBLIC) --------------------------------------------------------------------------------------- // ---- METHODS (PUBLIC) ---------------------------------------------------------------------------------------
/// <summary> /// <inheritdoc/>
/// Loads the data from the given <see cref="Stream"/>.
/// </summary>
/// <param name="stream">The <see cref="Stream"/> to load the data from.</param>
public void Load(Stream stream) public void Load(Stream stream)
{ {
using BinaryStream reader = new BinaryStream(stream, encoding: Encoding.ASCII, leaveOpen: true); using BinaryStream reader = new BinaryStream(stream, encoding: Encoding.ASCII, leaveOpen: true);
@ -113,20 +110,14 @@ namespace Syroot.Worms.Armageddon.ProjectX
} }
} }
/// <summary> /// <inheritdoc/>
/// Loads the data from the given file.
/// </summary>
/// <param name="fileName">The name of the file to load the data from.</param>
public void Load(string fileName) public void Load(string fileName)
{ {
using FileStream stream = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read); using FileStream stream = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read);
Load(stream); Load(stream);
} }
/// <summary> /// <inheritdoc/>
/// Saves the data into the given <paramref name="stream"/>.
/// </summary>
/// <param name="stream">The <see cref="Stream"/> to save the data to.</param>
public void Save(Stream stream) public void Save(Stream stream)
{ {
using BinaryStream writer = new BinaryStream(stream, encoding: Encoding.ASCII, leaveOpen: true); using BinaryStream writer = new BinaryStream(stream, encoding: Encoding.ASCII, leaveOpen: true);
@ -181,10 +172,7 @@ namespace Syroot.Worms.Armageddon.ProjectX
} }
} }
/// <summary> /// <inheritdoc/>
/// Saves the data in the given file.
/// </summary>
/// <param name="fileName">The name of the file to save the data in.</param>
public void Save(string fileName) public void Save(string fileName)
{ {
using FileStream stream = new FileStream(fileName, FileMode.Create, FileAccess.Write, FileShare.None); using FileStream stream = new FileStream(fileName, FileMode.Create, FileAccess.Write, FileShare.None);

View File

@ -107,10 +107,7 @@ namespace Syroot.Worms.Armageddon.ProjectX
// ---- METHODS (PUBLIC) --------------------------------------------------------------------------------------- // ---- METHODS (PUBLIC) ---------------------------------------------------------------------------------------
/// <summary> /// <inheritdoc/>
/// Loads the data from the given <see cref="Stream"/>.
/// </summary>
/// <param name="stream">The <see cref="Stream"/> to load the data from.</param>
public void Load(Stream stream) public void Load(Stream stream)
{ {
using BinaryStream reader = new BinaryStream(stream, encoding: Encoding.ASCII, leaveOpen: true); using BinaryStream reader = new BinaryStream(stream, encoding: Encoding.ASCII, leaveOpen: true);
@ -274,10 +271,7 @@ namespace Syroot.Worms.Armageddon.ProjectX
Utility = reader.ReadBoolean(); Utility = reader.ReadBoolean();
} }
/// <summary> /// <inheritdoc/>
/// Saves the data into the given <paramref name="stream"/>.
/// </summary>
/// <param name="stream">The <see cref="Stream"/> to save the data to.</param>
public void Save(Stream stream) public void Save(Stream stream)
{ {
using BinaryStream writer = new BinaryStream(stream, encoding: Encoding.ASCII, leaveOpen: true); using BinaryStream writer = new BinaryStream(stream, encoding: Encoding.ASCII, leaveOpen: true);

View File

@ -40,40 +40,28 @@ namespace Syroot.Worms.Armageddon
// ---- METHODS (PUBLIC) --------------------------------------------------------------------------------------- // ---- METHODS (PUBLIC) ---------------------------------------------------------------------------------------
/// <summary> /// <inheritdoc/>
/// Loads the data from the given <see cref="Stream"/>.
/// </summary>
/// <param name="stream">The <see cref="Stream"/> to load the data from.</param>
public void Load(Stream stream) public void Load(Stream stream)
{ {
using BinaryStream reader = new BinaryStream(stream, encoding: Encoding.ASCII, leaveOpen: true); using BinaryStream reader = new BinaryStream(stream, encoding: Encoding.ASCII, leaveOpen: true);
Settings = reader.ReadStruct<MapGeneratorSettings>(); Settings = reader.ReadStruct<MapGeneratorSettings>();
} }
/// <summary> /// <inheritdoc/>>
/// Loads the data from the given file.
/// </summary>
/// <param name="fileName">The name of the file to load the data from.</param>
public void Load(string fileName) public void Load(string fileName)
{ {
using FileStream stream = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read); using FileStream stream = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read);
Load(stream); Load(stream);
} }
/// <summary> /// <inheritdoc/>
/// Saves the data into the given <paramref name="stream"/>.
/// </summary>
/// <param name="stream">The <see cref="Stream"/> to save the data to.</param>
public void Save(Stream stream) public void Save(Stream stream)
{ {
using BinaryStream writer = new BinaryStream(stream, encoding: Encoding.ASCII); using BinaryStream writer = new BinaryStream(stream, encoding: Encoding.ASCII);
writer.WriteStruct(Settings); writer.WriteStruct(Settings);
} }
/// <summary> /// <inheritdoc/>
/// Saves the data in the given file.
/// </summary>
/// <param name="fileName">The name of the file to save the data in.</param>
public void Save(string fileName) public void Save(string fileName)
{ {
using FileStream stream = new FileStream(fileName, FileMode.Create, FileAccess.Write, FileShare.None); using FileStream stream = new FileStream(fileName, FileMode.Create, FileAccess.Write, FileShare.None);

View File

@ -90,10 +90,7 @@ namespace Syroot.Worms.Armageddon
// ---- METHODS (PUBLIC) --------------------------------------------------------------------------------------- // ---- METHODS (PUBLIC) ---------------------------------------------------------------------------------------
/// <summary> /// <inheritdoc/>
/// Loads the data from the given <see cref="Stream"/>.
/// </summary>
/// <param name="stream">The <see cref="Stream"/> to load the data from.</param>
public void Load(Stream stream) public void Load(Stream stream)
{ {
using BinaryStream reader = new BinaryStream(stream, encoding: Encoding.ASCII, leaveOpen: true); using BinaryStream reader = new BinaryStream(stream, encoding: Encoding.ASCII, leaveOpen: true);
@ -122,20 +119,14 @@ namespace Syroot.Worms.Armageddon
WaterDirPath = reader.ReadString(StringCoding.ByteCharCount); WaterDirPath = reader.ReadString(StringCoding.ByteCharCount);
} }
/// <summary> /// <inheritdoc/>
/// Loads the data from the given file.
/// </summary>
/// <param name="fileName">The name of the file to load the data from.</param>
public void Load(string fileName) public void Load(string fileName)
{ {
using FileStream stream = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read); using FileStream stream = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read);
Load(stream); Load(stream);
} }
/// <summary> /// <inheritdoc/>
/// Saves the data into the given <paramref name="stream"/>.
/// </summary>
/// <param name="stream">The <see cref="Stream"/> to save the data to.</param>
public void Save(Stream stream) public void Save(Stream stream)
{ {
using BinaryStream writer = new BinaryStream(stream, encoding: Encoding.ASCII); using BinaryStream writer = new BinaryStream(stream, encoding: Encoding.ASCII);
@ -166,10 +157,7 @@ namespace Syroot.Worms.Armageddon
writer.SatisfyOffset(fileSizeOffset, (int)writer.Position); writer.SatisfyOffset(fileSizeOffset, (int)writer.Position);
} }
/// <summary> /// <inheritdoc/>
/// Saves the data in the given file.
/// </summary>
/// <param name="fileName">The name of the file to save the data in.</param>
public void Save(string fileName) public void Save(string fileName)
{ {
using FileStream stream = new FileStream(fileName, FileMode.Create, FileAccess.Write, FileShare.None); using FileStream stream = new FileStream(fileName, FileMode.Create, FileAccess.Write, FileShare.None);

View File

@ -1,366 +1,360 @@
using System.Diagnostics; using System.Diagnostics;
using System.Drawing; using System.Drawing;
using System.IO; using System.IO;
using System.Text; using System.Text;
using Syroot.BinaryData; using Syroot.BinaryData;
using Syroot.Worms.Core.IO; using Syroot.Worms.Core.IO;
namespace Syroot.Worms.Armageddon namespace Syroot.Worms.Armageddon
{ {
/// <summary> /// <summary>
/// Represents a team stored in a <see cref="TeamContainer"/> file. /// Represents a team stored in a <see cref="TeamContainer"/> file.
/// </summary> /// </summary>
public class Team : ILoadable, ISaveable public class Team : ILoadable, ISaveable
{ {
// ---- CONSTANTS ---------------------------------------------------------------------------------------------- // ---- CONSTANTS ----------------------------------------------------------------------------------------------
private const int _missionCount = 33; private const int _missionCount = 33;
private const int _trainingMissionCount = 6; private const int _trainingMissionCount = 6;
// ---- CONSTRUCTORS & DESTRUCTOR ------------------------------------------------------------------------------ // ---- CONSTRUCTORS & DESTRUCTOR ------------------------------------------------------------------------------
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="Team"/> class. /// Initializes a new instance of the <see cref="Team"/> class.
/// </summary> /// </summary>
public Team() public Team()
{ {
WormNames = new string[8]; WormNames = new string[8];
MissionStatuses = new TeamMissionStatus[_missionCount]; MissionStatuses = new TeamMissionStatus[_missionCount];
TrainingMissionTimes = new int[_trainingMissionCount]; TrainingMissionTimes = new int[_trainingMissionCount];
Unknown1 = new int[10]; Unknown1 = new int[10];
TrainingMissionMedals = new byte[_trainingMissionCount]; TrainingMissionMedals = new byte[_trainingMissionCount];
Unknown2 = new byte[10]; Unknown2 = new byte[10];
Unknown3 = new int[7]; Unknown3 = new int[7];
} }
// ---- PROPERTIES --------------------------------------------------------------------------------------------- // ---- PROPERTIES ---------------------------------------------------------------------------------------------
/// <summary> /// <summary>
/// Gets or sets the name of the team. /// Gets or sets the name of the team.
/// </summary> /// </summary>
public string Name { get; set; } public string Name { get; set; }
/// <summary> /// <summary>
/// Gets or sets the 8 worm names. /// Gets or sets the 8 worm names.
/// </summary> /// </summary>
public string[] WormNames { get; set; } public string[] WormNames { get; set; }
/// <summary> /// <summary>
/// Gets or sets the AI intelligence difficulty level, from 0-5, where 0 is human-controlled. /// Gets or sets the AI intelligence difficulty level, from 0-5, where 0 is human-controlled.
/// </summary> /// </summary>
public byte CpuLevel { get; set; } public byte CpuLevel { get; set; }
/// <summary> /// <summary>
/// Gets or sets the name of soundbank for the voice of team worms. /// Gets or sets the name of soundbank for the voice of team worms.
/// </summary> /// </summary>
public string SoundBankName { get; set; } public string SoundBankName { get; set; }
public byte SoundBankLocation { get; set; } public byte SoundBankLocation { get; set; }
/// <summary> /// <summary>
/// Gets or sets the name of the team fanfare. /// Gets or sets the name of the team fanfare.
/// </summary> /// </summary>
public string FanfareName { get; set; } public string FanfareName { get; set; }
/// <summary> /// <summary>
/// Gets or sets a value indicating whether the fanfare with the name stored in <see cref="FanfareName"/> /// Gets or sets a value indicating whether the fanfare with the name stored in <see cref="FanfareName"/>
/// (<c>true</c>) or the player's countries' fanfare should be played (<c>false</c>). /// (<c>true</c>) or the player's countries' fanfare should be played (<c>false</c>).
/// </summary> /// </summary>
public byte UseCustomFanfare { get; set; } public byte UseCustomFanfare { get; set; }
/// <summary> /// <summary>
/// Gets or sets the sprite index of the team grave, -1 being a custom bitmap grave. /// Gets or sets the sprite index of the team grave, -1 being a custom bitmap grave.
/// </summary> /// </summary>
public sbyte GraveSprite { get; set; } public sbyte GraveSprite { get; set; }
/// <summary> /// <summary>
/// Gets or sets the file name of the team grave bitmap if it uses a custom one. /// Gets or sets the file name of the team grave bitmap if it uses a custom one.
/// </summary> /// </summary>
public string GraveFileName { get; set; } public string GraveFileName { get; set; }
/// <summary> /// <summary>
/// Gets or sets the team grave bitmap if it uses a custom one. /// Gets or sets the team grave bitmap if it uses a custom one.
/// </summary> /// </summary>
public RawBitmap Grave { get; set; } public RawBitmap Grave { get; set; }
/// <summary> /// <summary>
/// Gets or sets the team's special weapon. /// Gets or sets the team's special weapon.
/// </summary> /// </summary>
public TeamWeapon TeamWeapon { get; set; } public TeamWeapon TeamWeapon { get; set; }
/// <summary> /// <summary>
/// Gets or sets the number of games lost. /// Gets or sets the number of games lost.
/// </summary> /// </summary>
public int GamesLost { get; set; } public int GamesLost { get; set; }
/// <summary> /// <summary>
/// Gets or sets the number of deathmatch games lost. /// Gets or sets the number of deathmatch games lost.
/// </summary> /// </summary>
public int DeathmatchesLost { get; set; } public int DeathmatchesLost { get; set; }
/// <summary> /// <summary>
/// Gets or sets the number of games won. /// Gets or sets the number of games won.
/// </summary> /// </summary>
public int GamesWon { get; set; } public int GamesWon { get; set; }
/// <summary> /// <summary>
/// Gets or sets the number of deathmatch games won. /// Gets or sets the number of deathmatch games won.
/// </summary> /// </summary>
public int DeathmatchesWon { get; set; } public int DeathmatchesWon { get; set; }
/// <summary> /// <summary>
/// Gets or sets the number of games drawn. /// Gets or sets the number of games drawn.
/// </summary> /// </summary>
public int GamesDrawn { get; set; } public int GamesDrawn { get; set; }
/// <summary> /// <summary>
/// Gets or sets the number of deathmatch games drawn. /// Gets or sets the number of deathmatch games drawn.
/// </summary> /// </summary>
public int DeathmatchesDrawn { get; set; } public int DeathmatchesDrawn { get; set; }
/// <summary> /// <summary>
/// Gets or sets the number of opponent worms killed by this team. /// Gets or sets the number of opponent worms killed by this team.
/// </summary> /// </summary>
public int Kills { get; set; } public int Kills { get; set; }
/// <summary> /// <summary>
/// Gets or sets the number of opponent worms killed by this team in deathmatches. /// Gets or sets the number of opponent worms killed by this team in deathmatches.
/// </summary> /// </summary>
public int DeathmatchKills { get; set; } public int DeathmatchKills { get; set; }
/// <summary> /// <summary>
/// Gets or sets the number of worms which got killed in this team. /// Gets or sets the number of worms which got killed in this team.
/// </summary> /// </summary>
public int Deaths { get; set; } public int Deaths { get; set; }
/// <summary> /// <summary>
/// Gets or sets the number of worms which got killed in this team in deathmatches. /// Gets or sets the number of worms which got killed in this team in deathmatches.
/// </summary> /// </summary>
public int DeathmatchDeaths { get; set; } public int DeathmatchDeaths { get; set; }
/// <summary> /// <summary>
/// Gets or sets the array of 33 mission statuses. /// Gets or sets the array of 33 mission statuses.
/// </summary> /// </summary>
public TeamMissionStatus[] MissionStatuses { get; set; } public TeamMissionStatus[] MissionStatuses { get; set; }
/// <summary> /// <summary>
/// Gets or sets the file name of the team flag. /// Gets or sets the file name of the team flag.
/// </summary> /// </summary>
public string FlagFileName { get; set; } public string FlagFileName { get; set; }
/// <summary> /// <summary>
/// Gets or sets the bitmap of the team flag. /// Gets or sets the bitmap of the team flag.
/// </summary> /// </summary>
public RawBitmap Flag { get; set; } public RawBitmap Flag { get; set; }
/// <summary> /// <summary>
/// Gets or sets the deathmatch rank this team reached. /// Gets or sets the deathmatch rank this team reached.
/// </summary> /// </summary>
public byte DeathmatchRank { get; set; } public byte DeathmatchRank { get; set; }
/// <summary> /// <summary>
/// Gets or sets the seconds the team required to finish all 6 training missions. /// Gets or sets the seconds the team required to finish all 6 training missions.
/// </summary> /// </summary>
public int[] TrainingMissionTimes { get; set; } public int[] TrainingMissionTimes { get; set; }
/// <summary> /// <summary>
/// Gets or sets 10 unknown integer values. /// Gets or sets 10 unknown integer values.
/// </summary> /// </summary>
public int[] Unknown1 { get; set; } public int[] Unknown1 { get; set; }
/// <summary> /// <summary>
/// Gets or sets the medals the team achieved in all 6 training missions. /// Gets or sets the medals the team achieved in all 6 training missions.
/// </summary> /// </summary>
public byte[] TrainingMissionMedals { get; set; } public byte[] TrainingMissionMedals { get; set; }
/// <summary> /// <summary>
/// Gets or sets 10 unknown bytes. /// Gets or sets 10 unknown bytes.
/// </summary> /// </summary>
public byte[] Unknown2 { get; set; } public byte[] Unknown2 { get; set; }
/// <summary> /// <summary>
/// Gets or sets 7 unknown integer values. /// Gets or sets 7 unknown integer values.
/// </summary> /// </summary>
public int[] Unknown3 { get; set; } public int[] Unknown3 { get; set; }
/// <summary> /// <summary>
/// Gets or sets an unknown byte. /// Gets or sets an unknown byte.
/// </summary> /// </summary>
public byte Unknown4 { get; set; } public byte Unknown4 { get; set; }
// ---- METHODS (PUBLIC) --------------------------------------------------------------------------------------- // ---- METHODS (PUBLIC) ---------------------------------------------------------------------------------------
/// <summary> /// <inheritdoc/>
/// Loads the data from the given <see cref="Stream"/>. public void Load(Stream stream)
/// </summary> {
/// <param name="stream">The <see cref="Stream"/> to load the data from.</param> using BinaryStream reader = new BinaryStream(stream, encoding: Encoding.ASCII, leaveOpen: true);
public void Load(Stream stream)
{ Name = reader.ReadString(17);
using BinaryStream reader = new BinaryStream(stream, encoding: Encoding.ASCII, leaveOpen: true); WormNames = reader.ReadStrings(8, 17);
CpuLevel = reader.Read1Byte();
Name = reader.ReadString(17); SoundBankName = reader.ReadString(0x20);
WormNames = reader.ReadStrings(8, 17); SoundBankLocation = reader.Read1Byte();
CpuLevel = reader.Read1Byte(); FanfareName = reader.ReadString(0x20);
SoundBankName = reader.ReadString(0x20); UseCustomFanfare = reader.Read1Byte();
SoundBankLocation = reader.Read1Byte();
FanfareName = reader.ReadString(0x20); GraveSprite = reader.ReadSByte();
UseCustomFanfare = reader.Read1Byte(); if (GraveSprite < 0)
{
GraveSprite = reader.ReadSByte(); GraveFileName = reader.ReadString(0x20);
if (GraveSprite < 0) Grave = new RawBitmap()
{ {
GraveFileName = reader.ReadString(0x20); BitsPerPixel = 8,
Grave = new RawBitmap() Size = new Size(24, 32),
{ Palette = reader.ReadStructs<Color>(256),
BitsPerPixel = 8, Data = reader.ReadBytes(24 * 32)
Size = new Size(24, 32), };
Palette = reader.ReadStructs<Color>(256), }
Data = reader.ReadBytes(24 * 32)
}; TeamWeapon = reader.ReadEnum<TeamWeapon>(true);
} GamesLost = reader.ReadInt32();
DeathmatchesLost = reader.ReadInt32();
TeamWeapon = reader.ReadEnum<TeamWeapon>(true); GamesWon = reader.ReadInt32();
GamesLost = reader.ReadInt32(); DeathmatchesWon = reader.ReadInt32();
DeathmatchesLost = reader.ReadInt32(); GamesDrawn = reader.ReadInt32();
GamesWon = reader.ReadInt32(); DeathmatchesDrawn = reader.ReadInt32();
DeathmatchesWon = reader.ReadInt32(); Kills = reader.ReadInt32();
GamesDrawn = reader.ReadInt32(); DeathmatchKills = reader.ReadInt32();
DeathmatchesDrawn = reader.ReadInt32(); Deaths = reader.ReadInt32();
Kills = reader.ReadInt32(); DeathmatchDeaths = reader.ReadInt32();
DeathmatchKills = reader.ReadInt32(); MissionStatuses = reader.ReadStructs<TeamMissionStatus>(_missionCount);
Deaths = reader.ReadInt32();
DeathmatchDeaths = reader.ReadInt32(); FlagFileName = reader.ReadString(0x20);
MissionStatuses = reader.ReadStructs<TeamMissionStatus>(_missionCount); Flag = new RawBitmap()
{
FlagFileName = reader.ReadString(0x20); BitsPerPixel = 8,
Flag = new RawBitmap() Size = new Size(20, 17),
{ Palette = reader.ReadStructs<Color>(256),
BitsPerPixel = 8, Data = reader.ReadBytes(20 * 17)
Size = new Size(20, 17), };
Palette = reader.ReadStructs<Color>(256),
Data = reader.ReadBytes(20 * 17) DeathmatchRank = reader.Read1Byte();
}; TrainingMissionTimes = reader.ReadInt32s(_trainingMissionCount);
Unknown1 = reader.ReadInt32s(10);
DeathmatchRank = reader.Read1Byte(); TrainingMissionMedals = reader.ReadBytes(_trainingMissionCount);
TrainingMissionTimes = reader.ReadInt32s(_trainingMissionCount); Unknown2 = reader.ReadBytes(10);
Unknown1 = reader.ReadInt32s(10); Unknown3 = reader.ReadInt32s(7);
TrainingMissionMedals = reader.ReadBytes(_trainingMissionCount); Unknown4 = reader.Read1Byte();
Unknown2 = reader.ReadBytes(10); }
Unknown3 = reader.ReadInt32s(7);
Unknown4 = reader.Read1Byte(); /// <inheritdoc/>
} public void Save(Stream stream)
{
/// <summary> using BinaryStream writer = new BinaryStream(stream, encoding: Encoding.ASCII, leaveOpen: true);
/// Saves the data into the given <paramref name="stream"/>.
/// </summary> writer.WriteString(Name, 17);
/// <param name="stream">The <see cref="Stream"/> to save the data to.</param> writer.WriteStrings(WormNames, 17);
public void Save(Stream stream) writer.Write(CpuLevel);
{ writer.WriteString(SoundBankName, 0x20);
using BinaryStream writer = new BinaryStream(stream, encoding: Encoding.ASCII, leaveOpen: true); writer.Write(SoundBankLocation);
writer.WriteString(FanfareName, 0x20);
writer.WriteString(Name, 17); writer.Write(UseCustomFanfare);
writer.WriteStrings(WormNames, 17);
writer.Write(CpuLevel); writer.Write(GraveSprite);
writer.WriteString(SoundBankName, 0x20); if (GraveSprite < 0)
writer.Write(SoundBankLocation); {
writer.WriteString(FanfareName, 0x20); writer.WriteString(GraveFileName, 0x20);
writer.Write(UseCustomFanfare); writer.WriteStructs(Grave.Palette);
writer.Write(Grave.Data);
writer.Write(GraveSprite); }
if (GraveSprite < 0)
{ writer.WriteEnum(TeamWeapon, true);
writer.WriteString(GraveFileName, 0x20); writer.Write(GamesLost);
writer.WriteStructs(Grave.Palette); writer.Write(DeathmatchesLost);
writer.Write(Grave.Data); writer.Write(GamesWon);
} writer.Write(DeathmatchesWon);
writer.Write(GamesDrawn);
writer.WriteEnum(TeamWeapon, true); writer.Write(DeathmatchesDrawn);
writer.Write(GamesLost); writer.Write(Kills);
writer.Write(DeathmatchesLost); writer.Write(DeathmatchKills);
writer.Write(GamesWon); writer.Write(Deaths);
writer.Write(DeathmatchesWon);
writer.Write(GamesDrawn);
writer.Write(DeathmatchesDrawn);
writer.Write(Kills);
writer.Write(DeathmatchKills);
writer.Write(Deaths);
writer.Write(DeathmatchDeaths); writer.Write(DeathmatchDeaths);
writer.WriteStructs(MissionStatuses); writer.WriteStructs(MissionStatuses);
writer.WriteString(FlagFileName, 0x20); writer.WriteString(FlagFileName, 0x20);
writer.WriteStructs(Flag.Palette); writer.WriteStructs(Flag.Palette);
writer.Write(Flag.Data); writer.Write(Flag.Data);
writer.Write(DeathmatchRank); writer.Write(DeathmatchRank);
writer.Write(TrainingMissionTimes); writer.Write(TrainingMissionTimes);
writer.Write(Unknown1); writer.Write(Unknown1);
writer.Write(TrainingMissionMedals); writer.Write(TrainingMissionMedals);
writer.Write(Unknown2); writer.Write(Unknown2);
writer.Write(Unknown3); writer.Write(Unknown3);
writer.Write(Unknown4); writer.Write(Unknown4);
} }
} }
/// <summary> /// <summary>
/// Represents a team's progress in a mission. /// Represents a team's progress in a mission.
/// </summary> /// </summary>
[DebuggerDisplay("TeamMissionStatus Attemps={Attempts} Medal={Medal}")] [DebuggerDisplay("TeamMissionStatus Attemps={Attempts} Medal={Medal}")]
public struct TeamMissionStatus public struct TeamMissionStatus
{ {
/// <summary> /// <summary>
/// The number of attempts the team required to solve the mission. /// The number of attempts the team required to solve the mission.
/// </summary> /// </summary>
public int Attempts; public int Attempts;
/// <summary> /// <summary>
/// The medal the team got to solve the mission. /// The medal the team got to solve the mission.
/// </summary> /// </summary>
public int Medal; public int Medal;
} }
/// <summary> /// <summary>
/// Represents the special weapon of a team. /// Represents the special weapon of a team.
/// </summary> /// </summary>
public enum TeamWeapon : byte public enum TeamWeapon : byte
{ {
/// <summary> /// <summary>
/// The Flame Thrower weapon. /// The Flame Thrower weapon.
/// </summary> /// </summary>
Flamethrower, Flamethrower,
/// <summary> /// <summary>
/// The Mole Bomb weapon. /// The Mole Bomb weapon.
/// </summary> /// </summary>
MoleBomb, MoleBomb,
/// <summary> /// <summary>
/// The Old Woman weapon. /// The Old Woman weapon.
/// </summary> /// </summary>
OldWoman, OldWoman,
/// <summary> /// <summary>
/// The Homing Pigeon weapon. /// The Homing Pigeon weapon.
/// </summary> /// </summary>
HomingPigeon, HomingPigeon,
/// <summary> /// <summary>
/// The Sheep Launcher weapon. /// The Sheep Launcher weapon.
/// </summary> /// </summary>
SheepLauncher, SheepLauncher,
/// <summary> /// <summary>
/// The Mad Cow weapon. /// The Mad Cow weapon.
/// </summary> /// </summary>
MadCow, MadCow,
/// <summary> /// <summary>
/// The Holy Hand Grenade weapon. /// The Holy Hand Grenade weapon.
/// </summary> /// </summary>
HolyHandGrenade, HolyHandGrenade,
/// <summary> /// <summary>
/// The Super Sheep or Aqua Sheep weapon. /// The Super Sheep or Aqua Sheep weapon.
/// </summary> /// </summary>
SuperSheep SuperSheep
} }
} }

View File

@ -61,10 +61,7 @@ namespace Syroot.Worms.Armageddon
// ---- METHODS (PUBLIC) --------------------------------------------------------------------------------------- // ---- METHODS (PUBLIC) ---------------------------------------------------------------------------------------
/// <summary> /// <inheritdoc/>
/// Loads the data from the given <see cref="Stream"/>.
/// </summary>
/// <param name="stream">The <see cref="Stream"/> to load the data from.</param>
public void Load(Stream stream) public void Load(Stream stream)
{ {
using BinaryStream reader = new BinaryStream(stream, encoding: Encoding.ASCII, leaveOpen: true); using BinaryStream reader = new BinaryStream(stream, encoding: Encoding.ASCII, leaveOpen: true);
@ -83,20 +80,14 @@ namespace Syroot.Worms.Armageddon
Teams = new List<Team>(reader.Load<Team>(teamCount)); Teams = new List<Team>(reader.Load<Team>(teamCount));
} }
/// <summary> /// <inheritdoc/>
/// Loads the data from the given file.
/// </summary>
/// <param name="fileName">The name of the file to load the data from.</param>
public void Load(string fileName) public void Load(string fileName)
{ {
using FileStream stream = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read); using FileStream stream = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read);
Load(stream); Load(stream);
} }
/// <summary> /// <inheritdoc/>
/// Saves the data into the given <paramref name="stream"/>.
/// </summary>
/// <param name="stream">The <see cref="Stream"/> to save the data to.</param>
public void Save(Stream stream) public void Save(Stream stream)
{ {
using BinaryStream writer = new BinaryStream(stream, encoding: Encoding.ASCII); using BinaryStream writer = new BinaryStream(stream, encoding: Encoding.ASCII);
@ -115,10 +106,7 @@ namespace Syroot.Worms.Armageddon
team.Save(writer.BaseStream); team.Save(writer.BaseStream);
} }
/// <summary> /// <inheritdoc/>
/// Saves the data in the given file.
/// </summary>
/// <param name="fileName">The name of the file to save the data in.</param>
public void Save(string fileName) public void Save(string fileName)
{ {
using FileStream stream = new FileStream(fileName, FileMode.Create, FileAccess.Write, FileShare.None); using FileStream stream = new FileStream(fileName, FileMode.Create, FileAccess.Write, FileShare.None);

View File

@ -39,20 +39,14 @@ namespace Syroot.Worms.Mgame
// ---- METHODS (PUBLIC) --------------------------------------------------------------------------------------- // ---- METHODS (PUBLIC) ---------------------------------------------------------------------------------------
/// <summary> /// <inheritdoc/>
/// Loads the data from the file with the given <paramref name="fileName"/>.
/// </summary>
/// <param name="fileName">The name of the file to load the data from.</param>
public void Load(string fileName) public void Load(string fileName)
{ {
using FileStream stream = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read); using FileStream stream = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read);
Load(stream); Load(stream);
} }
/// <summary> /// <inheritdoc/>
/// Loads the data from the given <paramref name="stream"/>.
/// </summary>
/// <param name="stream">The <see cref="Stream"/> to load the data from.</param>
public void Load(Stream stream) public void Load(Stream stream)
{ {
UnknownA = stream.ReadInt32(); UnknownA = stream.ReadInt32();

View File

@ -36,20 +36,14 @@ namespace Syroot.Worms.Mgame
// ---- METHODS (PUBLIC) --------------------------------------------------------------------------------------- // ---- METHODS (PUBLIC) ---------------------------------------------------------------------------------------
/// <summary> /// <inheritdoc/>
/// Loads the data from the file with the given <paramref name="fileName"/>.
/// </summary>
/// <param name="fileName">The name of the file to load the data from.</param>
public void Load(string fileName) public void Load(string fileName)
{ {
using FileStream stream = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read); using FileStream stream = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read);
Load(stream); Load(stream);
} }
/// <summary> /// <inheritdoc/>
/// Loads the data from the given <paramref name="stream"/>.
/// </summary>
/// <param name="stream">The <see cref="Stream"/> to load the data from.</param>
public void Load(Stream stream) public void Load(Stream stream)
{ {
int elementCount = stream.ReadInt32(); int elementCount = stream.ReadInt32();

View File

@ -48,20 +48,14 @@ namespace Syroot.Worms.Mgame
// ---- METHODS (PUBLIC) --------------------------------------------------------------------------------------- // ---- METHODS (PUBLIC) ---------------------------------------------------------------------------------------
/// <summary> /// <inheritdoc/>
/// Loads the data from the file with the given <paramref name="fileName"/>.
/// </summary>
/// <param name="fileName">The name of the file to load the data from.</param>
public void Load(string fileName) public void Load(string fileName)
{ {
using FileStream stream = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read); using FileStream stream = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read);
Load(stream); Load(stream);
} }
/// <summary> /// <inheritdoc/>
/// Loads the data from the given <paramref name="stream"/>.
/// </summary>
/// <param name="stream">The <see cref="Stream"/> to load the data from.</param>
public void Load(Stream stream) public void Load(Stream stream)
{ {
byte[] data = stream.ReadBytes(ColorCount * 3); byte[] data = stream.ReadBytes(ColorCount * 3);

View File

@ -85,10 +85,7 @@ namespace Syroot.Worms.WorldParty
// ---- METHODS (PUBLIC) --------------------------------------------------------------------------------------- // ---- METHODS (PUBLIC) ---------------------------------------------------------------------------------------
/// <summary> /// <inheritdoc/>
/// Loads the data from the given <see cref="Stream"/>.
/// </summary>
/// <param name="stream">The <see cref="Stream"/> to load the data from.</param>
public void Load(Stream stream) public void Load(Stream stream)
{ {
using BinaryStream reader = new BinaryStream(stream, encoding: Encoding.ASCII, leaveOpen: true); using BinaryStream reader = new BinaryStream(stream, encoding: Encoding.ASCII, leaveOpen: true);
@ -116,20 +113,14 @@ namespace Syroot.Worms.WorldParty
WaterDirPath = reader.ReadString(StringCoding.ByteCharCount); WaterDirPath = reader.ReadString(StringCoding.ByteCharCount);
} }
/// <summary> /// <inheritdoc/>
/// Loads the data from the given file.
/// </summary>
/// <param name="fileName">The name of the file to load the data from.</param>
public void Load(string fileName) public void Load(string fileName)
{ {
using FileStream stream = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read); using FileStream stream = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read);
Load(stream); Load(stream);
} }
/// <summary> /// <inheritdoc/>
/// Saves the data into the given <paramref name="stream"/>.
/// </summary>
/// <param name="stream">The <see cref="Stream"/> to save the data to.</param>
public void Save(Stream stream) public void Save(Stream stream)
{ {
using BinaryStream writer = new BinaryStream(stream, encoding: Encoding.ASCII, leaveOpen: true); using BinaryStream writer = new BinaryStream(stream, encoding: Encoding.ASCII, leaveOpen: true);
@ -159,10 +150,7 @@ namespace Syroot.Worms.WorldParty
writer.SatisfyOffset(fileSizeOffset, (int)writer.Position); writer.SatisfyOffset(fileSizeOffset, (int)writer.Position);
} }
/// <summary> /// <inheritdoc/>
/// Saves the data in the given file.
/// </summary>
/// <param name="fileName">The name of the file to save the data in.</param>
public void Save(string fileName) public void Save(string fileName)
{ {
using FileStream stream = new FileStream(fileName, FileMode.Create, FileAccess.Write, FileShare.None); using FileStream stream = new FileStream(fileName, FileMode.Create, FileAccess.Write, FileShare.None);

View File

@ -189,10 +189,7 @@ namespace Syroot.Worms.WorldParty
// ---- METHODS (PUBLIC) --------------------------------------------------------------------------------------- // ---- METHODS (PUBLIC) ---------------------------------------------------------------------------------------
/// <summary> /// <inheritdoc/>
/// Loads the data from the given <see cref="Stream"/>.
/// </summary>
/// <param name="stream">The <see cref="Stream"/> to load the data from.</param>
public void Load(Stream stream) public void Load(Stream stream)
{ {
using BinaryStream reader = new BinaryStream(stream, encoding: Encoding.ASCII, leaveOpen: true); using BinaryStream reader = new BinaryStream(stream, encoding: Encoding.ASCII, leaveOpen: true);
@ -248,10 +245,7 @@ namespace Syroot.Worms.WorldParty
Unknown2 = reader.ReadInt32s(7); Unknown2 = reader.ReadInt32s(7);
} }
/// <summary> /// <inheritdoc/>
/// Saves the data into the given <paramref name="stream"/>.
/// </summary>
/// <param name="stream">The <see cref="Stream"/> to save the data to.</param>
public void Save(Stream stream) public void Save(Stream stream)
{ {
using BinaryStream writer = new BinaryStream(stream, encoding: Encoding.ASCII, leaveOpen: true); using BinaryStream writer = new BinaryStream(stream, encoding: Encoding.ASCII, leaveOpen: true);

View File

@ -65,10 +65,7 @@ namespace Syroot.Worms.WorldParty
// ---- METHODS (PUBLIC) --------------------------------------------------------------------------------------- // ---- METHODS (PUBLIC) ---------------------------------------------------------------------------------------
/// <summary> /// <inheritdoc/>
/// Loads the data from the given <see cref="Stream"/>.
/// </summary>
/// <param name="stream">The <see cref="Stream"/> to load the data from.</param>
public void Load(Stream stream) public void Load(Stream stream)
{ {
using BinaryStream reader = new BinaryStream(stream, encoding: Encoding.ASCII, leaveOpen: true); using BinaryStream reader = new BinaryStream(stream, encoding: Encoding.ASCII, leaveOpen: true);
@ -88,20 +85,14 @@ namespace Syroot.Worms.WorldParty
Teams = new List<Team>(reader.Load<Team>(teamCount)); Teams = new List<Team>(reader.Load<Team>(teamCount));
} }
/// <summary> /// <inheritdoc/>
/// Loads the data from the given file.
/// </summary>
/// <param name="fileName">The name of the file to load the data from.</param>
public void Load(string fileName) public void Load(string fileName)
{ {
using FileStream stream = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read); using FileStream stream = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read);
Load(stream); Load(stream);
} }
/// <summary> /// <inheritdoc/>
/// Saves the data into the given <paramref name="stream"/>.
/// </summary>
/// <param name="stream">The <see cref="Stream"/> to save the data to.</param>
public void Save(Stream stream) public void Save(Stream stream)
{ {
using BinaryStream writer = new BinaryStream(stream, encoding: Encoding.ASCII, leaveOpen: true); using BinaryStream writer = new BinaryStream(stream, encoding: Encoding.ASCII, leaveOpen: true);
@ -121,10 +112,7 @@ namespace Syroot.Worms.WorldParty
team.Save(writer.BaseStream); team.Save(writer.BaseStream);
} }
/// <summary> /// <inheritdoc/>
/// Saves the data in the given file.
/// </summary>
/// <param name="fileName">The name of the file to save the data in.</param>
public void Save(string fileName) public void Save(string fileName)
{ {
using FileStream stream = new FileStream(fileName, FileMode.Create, FileAccess.Write, FileShare.None); using FileStream stream = new FileStream(fileName, FileMode.Create, FileAccess.Write, FileShare.None);

View File

@ -90,10 +90,7 @@ namespace Syroot.Worms.Worms2
// ---- METHODS (PUBLIC) --------------------------------------------------------------------------------------- // ---- METHODS (PUBLIC) ---------------------------------------------------------------------------------------
/// <summary> /// <inheritdoc/>
/// Loads the data from the given <see cref="Stream"/>.
/// </summary>
/// <param name="stream">The <see cref="Stream"/> to load the data from.</param>
public void Load(Stream stream) public void Load(Stream stream)
{ {
using BinaryStream reader = new BinaryStream(stream, encoding: Encoding.ASCII, leaveOpen: true); using BinaryStream reader = new BinaryStream(stream, encoding: Encoding.ASCII, leaveOpen: true);
@ -122,20 +119,14 @@ namespace Syroot.Worms.Worms2
WaterDirPath = reader.ReadString(StringCoding.ByteCharCount); WaterDirPath = reader.ReadString(StringCoding.ByteCharCount);
} }
/// <summary> /// <inheritdoc/>
/// Loads the data from the given file.
/// </summary>
/// <param name="fileName">The name of the file to load the data from.</param>
public void Load(string fileName) public void Load(string fileName)
{ {
using FileStream stream = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read); using FileStream stream = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read);
Load(stream); Load(stream);
} }
/// <summary> /// <inheritdoc/>
/// Saves the data into the given <paramref name="stream"/>.
/// </summary>
/// <param name="stream">The <see cref="Stream"/> to save the data to.</param>
public void Save(Stream stream) public void Save(Stream stream)
{ {
using BinaryStream writer = new BinaryStream(stream, encoding: Encoding.ASCII, leaveOpen: true); using BinaryStream writer = new BinaryStream(stream, encoding: Encoding.ASCII, leaveOpen: true);
@ -166,10 +157,7 @@ namespace Syroot.Worms.Worms2
writer.SatisfyOffset(fileSizeOffset, (int)writer.Position); writer.SatisfyOffset(fileSizeOffset, (int)writer.Position);
} }
/// <summary> /// <inheritdoc/>
/// Saves the data in the given file.
/// </summary>
/// <param name="fileName">The name of the file to save the data in.</param>
public void Save(string fileName) public void Save(string fileName)
{ {
using FileStream stream = new FileStream(fileName, FileMode.Create, FileAccess.Write, FileShare.None); using FileStream stream = new FileStream(fileName, FileMode.Create, FileAccess.Write, FileShare.None);

View File

@ -207,10 +207,7 @@ namespace Syroot.Worms.Worms2
// ---- METHODS (PUBLIC) --------------------------------------------------------------------------------------- // ---- METHODS (PUBLIC) ---------------------------------------------------------------------------------------
/// <summary> /// <inheritdoc/>
/// Loads the data from the given <see cref="Stream"/>.
/// </summary>
/// <param name="stream">The <see cref="Stream"/> to load the data from.</param>
public void Load(Stream stream) public void Load(Stream stream)
{ {
using BinaryStream reader = new BinaryStream(stream, encoding: Encoding.ASCII, leaveOpen: true); using BinaryStream reader = new BinaryStream(stream, encoding: Encoding.ASCII, leaveOpen: true);
@ -256,20 +253,14 @@ namespace Syroot.Worms.Worms2
UseOilDrums = reader.ReadBoolean(BooleanCoding.Dword); UseOilDrums = reader.ReadBoolean(BooleanCoding.Dword);
} }
/// <summary> /// <inheritdoc/>
/// Loads the data from the given file.
/// </summary>
/// <param name="fileName">The name of the file to load the data from.</param>
public void Load(string fileName) public void Load(string fileName)
{ {
using FileStream stream = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read); using FileStream stream = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read);
Load(stream); Load(stream);
} }
/// <summary> /// <inheritdoc/>
/// Saves the data into the given <paramref name="stream"/>.
/// </summary>
/// <param name="stream">The <see cref="Stream"/> to save the data to.</param>
public void Save(Stream stream) public void Save(Stream stream)
{ {
using BinaryStream writer = new BinaryStream(stream, encoding: Encoding.ASCII, leaveOpen: true); using BinaryStream writer = new BinaryStream(stream, encoding: Encoding.ASCII, leaveOpen: true);
@ -312,10 +303,7 @@ namespace Syroot.Worms.Worms2
writer.Write(UseOilDrums, BooleanCoding.Dword); writer.Write(UseOilDrums, BooleanCoding.Dword);
} }
/// <summary> /// <inheritdoc/>
/// Saves the data in the given file.
/// </summary>
/// <param name="fileName">The name of the file to save the data in.</param>
public void Save(string fileName) public void Save(string fileName)
{ {
using FileStream stream = new FileStream(fileName, FileMode.Create, FileAccess.Write, FileShare.None); using FileStream stream = new FileStream(fileName, FileMode.Create, FileAccess.Write, FileShare.None);

View File

@ -47,10 +47,7 @@ namespace Syroot.Worms.Worms2
// ---- METHODS (PUBLIC) --------------------------------------------------------------------------------------- // ---- METHODS (PUBLIC) ---------------------------------------------------------------------------------------
/// <summary> /// <inheritdoc/>
/// Loads the data from the given <see cref="Stream"/>.
/// </summary>
/// <param name="stream">The <see cref="Stream"/> to load the data from.</param>
public void Load(Stream stream) public void Load(Stream stream)
{ {
using BinaryStream reader = new BinaryStream(stream, encoding: Encoding.ASCII, leaveOpen: true); using BinaryStream reader = new BinaryStream(stream, encoding: Encoding.ASCII, leaveOpen: true);
@ -66,20 +63,14 @@ namespace Syroot.Worms.Worms2
Weapons[i] = reader.ReadStruct<SchemeWeaponSetting>(); Weapons[i] = reader.ReadStruct<SchemeWeaponSetting>();
} }
/// <summary> /// <inheritdoc/>
/// Loads the data from the given file.
/// </summary>
/// <param name="fileName">The name of the file to load the data from.</param>
public void Load(string fileName) public void Load(string fileName)
{ {
using FileStream stream = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read); using FileStream stream = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read);
Load(stream); Load(stream);
} }
/// <summary> /// <inheritdoc/>
/// Saves the data into the given <paramref name="stream"/>.
/// </summary>
/// <param name="stream">The <see cref="Stream"/> to save the data to.</param>
public void Save(Stream stream) public void Save(Stream stream)
{ {
using BinaryStream writer = new BinaryStream(stream, encoding: Encoding.ASCII, leaveOpen: true); using BinaryStream writer = new BinaryStream(stream, encoding: Encoding.ASCII, leaveOpen: true);
@ -93,10 +84,7 @@ namespace Syroot.Worms.Worms2
writer.WriteStruct(weapon); writer.WriteStruct(weapon);
} }
/// <summary> /// <inheritdoc/>
/// Saves the data in the given file.
/// </summary>
/// <param name="fileName">The name of the file to save the data in.</param>
public void Save(string fileName) public void Save(string fileName)
{ {
using FileStream stream = new FileStream(fileName, FileMode.Create, FileAccess.Write, FileShare.None); using FileStream stream = new FileStream(fileName, FileMode.Create, FileAccess.Write, FileShare.None);

View File

@ -103,10 +103,7 @@ namespace Syroot.Worms.Worms2
// ---- METHODS (PUBLIC) --------------------------------------------------------------------------------------- // ---- METHODS (PUBLIC) ---------------------------------------------------------------------------------------
/// <summary> /// <inheritdoc/>
/// Loads the data from the given <see cref="Stream"/>.
/// </summary>
/// <param name="stream">The <see cref="Stream"/> to load the data from.</param>
public void Load(Stream stream) public void Load(Stream stream)
{ {
using BinaryStream reader = new BinaryStream(stream, encoding: Encoding.ASCII, leaveOpen: true); using BinaryStream reader = new BinaryStream(stream, encoding: Encoding.ASCII, leaveOpen: true);
@ -153,10 +150,7 @@ namespace Syroot.Worms.Worms2
Points = reader.ReadInt32(); Points = reader.ReadInt32();
} }
/// <summary> /// <inheritdoc/>
/// Saves the data into the given <paramref name="stream"/>.
/// </summary>
/// <param name="stream">The <see cref="Stream"/> to save the data to.</param>
public void Save(Stream stream) public void Save(Stream stream)
{ {
using BinaryStream writer = new BinaryStream(stream, encoding: Encoding.ASCII, leaveOpen: true); using BinaryStream writer = new BinaryStream(stream, encoding: Encoding.ASCII, leaveOpen: true);

View File

@ -41,10 +41,7 @@ namespace Syroot.Worms.Worms2
// ---- METHODS (PUBLIC) --------------------------------------------------------------------------------------- // ---- METHODS (PUBLIC) ---------------------------------------------------------------------------------------
/// <summary> /// <inheritdoc/>
/// Loads the data from the given <see cref="Stream"/>.
/// </summary>
/// <param name="stream">The <see cref="Stream"/> to load the data from.</param>
public void Load(Stream stream) public void Load(Stream stream)
{ {
using BinaryStream reader = new BinaryStream(stream, encoding: Encoding.ASCII, leaveOpen: true); using BinaryStream reader = new BinaryStream(stream, encoding: Encoding.ASCII, leaveOpen: true);
@ -53,20 +50,14 @@ namespace Syroot.Worms.Worms2
Teams.Add(reader.Load<Team>()); Teams.Add(reader.Load<Team>());
} }
/// <summary> /// <inheritdoc/>
/// Loads the data from the given file.
/// </summary>
/// <param name="fileName">The name of the file to load the data from.</param>
public void Load(string fileName) public void Load(string fileName)
{ {
using FileStream stream = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read); using FileStream stream = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read);
Load(stream); Load(stream);
} }
/// <summary> /// <inheritdoc/>
/// Saves the data into the given <paramref name="stream"/>.
/// </summary>
/// <param name="stream">The <see cref="Stream"/> to save the data to.</param>
public void Save(Stream stream) public void Save(Stream stream)
{ {
using BinaryStream writer = new BinaryStream(stream, encoding: Encoding.ASCII, leaveOpen: true); using BinaryStream writer = new BinaryStream(stream, encoding: Encoding.ASCII, leaveOpen: true);
@ -74,10 +65,7 @@ namespace Syroot.Worms.Worms2
team.Save(writer.BaseStream); team.Save(writer.BaseStream);
} }
/// <summary> /// <inheritdoc/>
/// Saves the data in the given file.
/// </summary>
/// <param name="fileName">The name of the file to save the data in.</param>
public void Save(string fileName) public void Save(string fileName)
{ {
using FileStream stream = new FileStream(fileName, FileMode.Create, FileAccess.Write, FileShare.None); using FileStream stream = new FileStream(fileName, FileMode.Create, FileAccess.Write, FileShare.None);