Skip to content

Commit

Permalink
Formatting clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
sanmadjack committed Sep 7, 2012
1 parent b19dc2c commit 3579f63
Show file tree
Hide file tree
Showing 27 changed files with 263 additions and 306 deletions.
3 changes: 0 additions & 3 deletions Converters/AConverter.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace GameSaveInfo.Converters {
public class AConverter {
Expand Down
11 changes: 5 additions & 6 deletions Files/AFile.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;
using System.IO;
using System.Xml;
using XmlData;
namespace GameSaveInfo {
public abstract class AFile: AXmlDataSubEntry {
public abstract class AFile : AXmlDataSubEntry {
public string Name { get; protected set; }
public string Path { get; protected set; }
public string OnlyFor { get; protected set; }
Expand All @@ -18,13 +16,14 @@ protected AFile(string name, string path)
Path = path;
}

protected AFile(AXmlDataSubEntry parent, string name, string path): base(parent) {
protected AFile(AXmlDataSubEntry parent, string name, string path)
: base(parent) {
Name = name;
Path = path;
}

protected AFile(AXmlDataSubEntry parent, XmlElement element)
: base(parent,element) {
: base(parent, element) {

}

Expand Down
103 changes: 50 additions & 53 deletions Files/Exclude.cs
Original file line number Diff line number Diff line change
@@ -1,53 +1,50 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;
using XmlData;
namespace GameSaveInfo {
public class Exclude: AFile {
public string Type { get; protected set; }

public override string ElementName {
get { return "exclude"; }
}

protected Exclude(string name, string path, string type) : base(name, path) {
Type = type;
}

public Exclude(Include parent, string name, string path)
: this(parent, name, path, parent.Type) {
}


protected Exclude(FileType parent, string name, string path):
this(parent, name, path, parent.Type) {
}

private Exclude(AXmlDataSubEntry parent, string name, string path, string type)
: base(parent, name, path) {
this.Type = type;
}


public Exclude(Include parent, XmlElement element) : this(parent, element, parent.Type) { }

protected Exclude(FileType parent, XmlElement element) : this(parent, element, parent.Type) { }



private Exclude(AXmlDataSubEntry parent, XmlElement element, string type)
: base(parent, element) {
this.Type = type;
}

protected override void LoadMoreData(XmlElement element) {

}

protected override XmlElement WriteMoreData(XmlElement element) {
return element;
}
}
}
using System.Xml;
using XmlData;
namespace GameSaveInfo {
public class Exclude : AFile {
public string Type { get; protected set; }

public override string ElementName {
get { return "exclude"; }
}

protected Exclude(string name, string path, string type)
: base(name, path) {
Type = type;
}

public Exclude(Include parent, string name, string path)
: this(parent, name, path, parent.Type) {
}


protected Exclude(FileType parent, string name, string path) :
this(parent, name, path, parent.Type) {
}

private Exclude(AXmlDataSubEntry parent, string name, string path, string type)
: base(parent, name, path) {
this.Type = type;
}


public Exclude(Include parent, XmlElement element) : this(parent, element, parent.Type) { }

protected Exclude(FileType parent, XmlElement element) : this(parent, element, parent.Type) { }



private Exclude(AXmlDataSubEntry parent, XmlElement element, string type)
: base(parent, element) {
this.Type = type;
}

protected override void LoadMoreData(XmlElement element) {

}

protected override XmlElement WriteMoreData(XmlElement element) {
return element;
}
}
}
11 changes: 5 additions & 6 deletions Files/FileType.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;
using XmlData;
namespace GameSaveInfo {
public class FileType: AXmlDataSubEntry {
public class FileType : AXmlDataSubEntry {
public List<Include> Inclusions = new List<Include>();
public string Type { get; protected set; }

Expand All @@ -14,12 +12,13 @@ public override string ElementName {
}


public FileType( GameVersion version, string name): base(version) {
public FileType(GameVersion version, string name)
: base(version) {
this.Type = name;
}

public FileType(GameVersion version, XmlElement element)
: base(version,element) {
: base(version, element) {
}

protected override void LoadData(XmlElement element) {
Expand All @@ -36,7 +35,7 @@ protected override void LoadData(XmlElement element) {
foreach (XmlElement child in element.ChildNodes) {
switch (child.Name) {
case "include":
Include save = new Include(this,child);
Include save = new Include(this, child);
Inclusions.Add(save);
break;
default:
Expand Down
12 changes: 4 additions & 8 deletions Files/Identifier.cs
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;
using System.Xml;
namespace GameSaveInfo {
public class Identifier: AFile {
public Identifier(GameVersion version, XmlElement element) : base(version,element) { }
public class Identifier : AFile {
public Identifier(GameVersion version, XmlElement element) : base(version, element) { }

public override string ElementName {
get { return "identifier"; }
}

protected override void LoadMoreData(XmlElement element) {

}

protected override XmlElement WriteMoreData(XmlElement element) {
Expand Down
108 changes: 53 additions & 55 deletions Files/Include.cs
Original file line number Diff line number Diff line change
@@ -1,55 +1,53 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;
namespace GameSaveInfo {
public class Include: Exclude {
public List<Exclude> Exclusions = new List<Exclude>();

public override string ElementName {
get {
return "include";
}
}

public Include(string name, string path, string type)
: base(name, path, type) {
}

public Include(FileType parent, string name, string path)
: base(parent, name, path) {
}

public Include(FileType parent, XmlElement element)
: base(parent, element) {
}

protected override void LoadMoreData(XmlElement element) {
foreach (XmlElement child in element.ChildNodes) {
switch (child.Name) {
case "exclude":
Exclude except = new Exclude(this, child);
Exclusions.Add(except);
break;
default:
throw new NotSupportedException(child.Name);
}
}
}

protected override XmlElement WriteMoreData(XmlElement element) {
foreach (Exclude ex in Exclusions) {
element.AppendChild(ex.XML);
}
return element;
}

public Exclude addExclusion(string filePath, string fileName) {
Exclude except = new Exclude(this, fileName, filePath);
Exclusions.Add(except);
this.XML.AppendChild(except.XML);
return except;
}
}
}
using System;
using System.Collections.Generic;
using System.Xml;
namespace GameSaveInfo {
public class Include : Exclude {
public List<Exclude> Exclusions = new List<Exclude>();

public override string ElementName {
get {
return "include";
}
}

public Include(string name, string path, string type)
: base(name, path, type) {
}

public Include(FileType parent, string name, string path)
: base(parent, name, path) {
}

public Include(FileType parent, XmlElement element)
: base(parent, element) {
}

protected override void LoadMoreData(XmlElement element) {
foreach (XmlElement child in element.ChildNodes) {
switch (child.Name) {
case "exclude":
Exclude except = new Exclude(this, child);
Exclusions.Add(except);
break;
default:
throw new NotSupportedException(child.Name);
}
}
}

protected override XmlElement WriteMoreData(XmlElement element) {
foreach (Exclude ex in Exclusions) {
element.AppendChild(ex.XML);
}
return element;
}

public Exclude addExclusion(string filePath, string fileName) {
Exclude except = new Exclude(this, fileName, filePath);
Exclusions.Add(except);
this.XML.AppendChild(except.XML);
return except;
}
}
}
9 changes: 5 additions & 4 deletions Game.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using System;
using System.Xml;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;
using System.Collections.Generic;
using System.Xml;
using XmlData;
namespace GameSaveInfo {
public class Game : AXmlDataEntry, IComparable<Game> {
Expand All @@ -15,10 +15,11 @@ public class Game : AXmlDataEntry, IComparable<Game> {

public List<GameVersion> Versions = new List<GameVersion>();

protected Game(XmlDocument doc): base(doc) { }
protected Game(XmlDocument doc) : base(doc) { }


public Game(string name, string title, string comment, bool deprecated, GameType type, XmlDocument doc): this(doc) {
public Game(string name, string title, string comment, bool deprecated, GameType type, XmlDocument doc)
: this(doc) {
this.Name = name;
this.Title = title;
this.Comment = comment;
Expand Down
11 changes: 6 additions & 5 deletions GameIdentifier.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;
namespace GameSaveInfo {
public class GameIdentifier: IComparable<GameIdentifier>, IEquatable<GameIdentifier> {
public class GameIdentifier : IComparable<GameIdentifier>, IEquatable<GameIdentifier> {
public String Name { get; protected set; }
public String OS { get; protected set; }
public String Platform { get; protected set; }
Expand All @@ -14,9 +13,10 @@ public class GameIdentifier: IComparable<GameIdentifier>, IEquatable<GameIdentif
public String Type { get; protected set; }


public static readonly List<string> attributes = new List<string> { "os", "platform", "region", "media", "release","type", "gsm_id" };
public static readonly List<string> attributes = new List<string> { "os", "platform", "region", "media", "release", "type", "gsm_id" };

public GameIdentifier(string name, string os, string platform, string region, string media, string release,string type): this(name,release) {
public GameIdentifier(string name, string os, string platform, string region, string media, string release, string type)
: this(name, release) {
this.OS = os;
this.Platform = platform;
this.Release = release;
Expand All @@ -28,7 +28,8 @@ public GameIdentifier(string name, string release) {
this.Name = name;
this.Release = release;
}
public GameIdentifier(string name, XmlElement element): this(element) {
public GameIdentifier(string name, XmlElement element)
: this(element) {
this.Name = name;
}
public GameIdentifier(XmlElement element) {
Expand Down
Loading

0 comments on commit 3579f63

Please sign in to comment.