StyleCop clean OpenRA.Game

This commit is contained in:
Matthias Mailänder
2015-01-02 15:11:36 +01:00
parent 9dd607c846
commit 44cd174a8d
61 changed files with 628 additions and 581 deletions

View File

@@ -19,17 +19,17 @@ namespace OpenRA
public readonly Actor self;
public World world { get { return self.World; } }
internal TypeDictionary dict;
internal TypeDictionary Dict;
public ActorInitializer(Actor actor, TypeDictionary dict)
{
this.self = actor;
this.dict = dict;
self = actor;
Dict = dict;
}
public T Get<T>() where T : IActorInit { return dict.Get<T>(); }
public U Get<T, U>() where T : IActorInit<U> { return dict.Get<T>().Value(world); }
public bool Contains<T>() where T : IActorInit { return dict.Contains<T>(); }
public T Get<T>() where T : IActorInit { return Dict.Get<T>(); }
public U Get<T, U>() where T : IActorInit<U> { return Dict.Get<T>().Value(world); }
public bool Contains<T>() where T : IActorInit { return Dict.Contains<T>(); }
}
public interface IActorInit { }
@@ -41,7 +41,7 @@ namespace OpenRA
public class FacingInit : IActorInit<int>
{
[FieldFromYamlKey] public readonly int value = 128;
[FieldFromYamlKey] readonly int value = 128;
public FacingInit() { }
public FacingInit(int init) { value = init; }
public int Value(World world) { return value; }
@@ -49,7 +49,7 @@ namespace OpenRA
public class TurretFacingInit : IActorInit<int>
{
[FieldFromYamlKey] public readonly int value = 128;
[FieldFromYamlKey] readonly int value = 128;
public TurretFacingInit() { }
public TurretFacingInit(int init) { value = init; }
public int Value(World world) { return value; }
@@ -57,7 +57,7 @@ namespace OpenRA
public class LocationInit : IActorInit<CPos>
{
[FieldFromYamlKey] public readonly CPos value = CPos.Zero;
[FieldFromYamlKey] readonly CPos value = CPos.Zero;
public LocationInit() { }
public LocationInit(CPos init) { value = init; }
public CPos Value(World world) { return value; }
@@ -65,7 +65,7 @@ namespace OpenRA
public class SubCellInit : IActorInit<SubCell>
{
[FieldFromYamlKey] public readonly int value = (int)SubCell.FullCell;
[FieldFromYamlKey] readonly int value = (int)SubCell.FullCell;
public SubCellInit() { }
public SubCellInit(int init) { value = init; }
public SubCellInit(SubCell init) { value = (int)init; }
@@ -74,7 +74,7 @@ namespace OpenRA
public class CenterPositionInit : IActorInit<WPos>
{
[FieldFromYamlKey] public readonly WPos value = WPos.Zero;
[FieldFromYamlKey] readonly WPos value = WPos.Zero;
public CenterPositionInit() { }
public CenterPositionInit(WPos init) { value = init; }
public WPos Value(World world) { return value; }