diff --git a/src/DotRecast.Recast/RcAreaModification.cs b/src/DotRecast.Recast/RcAreaModification.cs index abd33dc..a9946c7 100644 --- a/src/DotRecast.Recast/RcAreaModification.cs +++ b/src/DotRecast.Recast/RcAreaModification.cs @@ -24,8 +24,8 @@ namespace DotRecast.Recast { public const int RC_AREA_FLAGS_MASK = 0x3F; - public int Value { get; } - public int Mask { get; } + public readonly int Value; + public readonly int Mask; /** * Mask is set to all available bits, which means value is fully applied @@ -35,7 +35,7 @@ namespace DotRecast.Recast */ public RcAreaModification(int value) { - this.Value = value; + Value = value; Mask = RC_AREA_FLAGS_MASK; } @@ -48,8 +48,8 @@ namespace DotRecast.Recast */ public RcAreaModification(int value, int mask) { - this.Value = value; - this.Mask = mask; + Value = value; + Mask = mask; } public RcAreaModification(RcAreaModification other) diff --git a/test/DotRecast.Detour.Crowd.Test/SampleAreaModifications.cs b/test/DotRecast.Detour.Crowd.Test/SampleAreaModifications.cs index 612b3aa..9f11338 100644 --- a/test/DotRecast.Detour.Crowd.Test/SampleAreaModifications.cs +++ b/test/DotRecast.Detour.Crowd.Test/SampleAreaModifications.cs @@ -30,12 +30,12 @@ public class SampleAreaModifications public const int SAMPLE_POLYAREA_TYPE_GRASS = 0x5; public const int SAMPLE_POLYAREA_TYPE_JUMP = 0x6; - public static RcAreaModification SAMPLE_AREAMOD_GROUND = new RcAreaModification(SAMPLE_POLYAREA_TYPE_GROUND, SAMPLE_POLYAREA_TYPE_MASK); - public static RcAreaModification SAMPLE_AREAMOD_WATER = new RcAreaModification(SAMPLE_POLYAREA_TYPE_WATER, SAMPLE_POLYAREA_TYPE_MASK); - public static RcAreaModification SAMPLE_AREAMOD_ROAD = new RcAreaModification(SAMPLE_POLYAREA_TYPE_ROAD, SAMPLE_POLYAREA_TYPE_MASK); - public static RcAreaModification SAMPLE_AREAMOD_GRASS = new RcAreaModification(SAMPLE_POLYAREA_TYPE_GRASS, SAMPLE_POLYAREA_TYPE_MASK); - public static RcAreaModification SAMPLE_AREAMOD_DOOR = new RcAreaModification(SAMPLE_POLYAREA_TYPE_DOOR, SAMPLE_POLYAREA_TYPE_DOOR); - public static RcAreaModification SAMPLE_AREAMOD_JUMP = new RcAreaModification(SAMPLE_POLYAREA_TYPE_JUMP, SAMPLE_POLYAREA_TYPE_JUMP); + public static readonly RcAreaModification SAMPLE_AREAMOD_GROUND = new RcAreaModification(SAMPLE_POLYAREA_TYPE_GROUND, SAMPLE_POLYAREA_TYPE_MASK); + public static readonly RcAreaModification SAMPLE_AREAMOD_WATER = new RcAreaModification(SAMPLE_POLYAREA_TYPE_WATER, SAMPLE_POLYAREA_TYPE_MASK); + public static readonly RcAreaModification SAMPLE_AREAMOD_ROAD = new RcAreaModification(SAMPLE_POLYAREA_TYPE_ROAD, SAMPLE_POLYAREA_TYPE_MASK); + public static readonly RcAreaModification SAMPLE_AREAMOD_GRASS = new RcAreaModification(SAMPLE_POLYAREA_TYPE_GRASS, SAMPLE_POLYAREA_TYPE_MASK); + public static readonly RcAreaModification SAMPLE_AREAMOD_DOOR = new RcAreaModification(SAMPLE_POLYAREA_TYPE_DOOR, SAMPLE_POLYAREA_TYPE_DOOR); + public static readonly RcAreaModification SAMPLE_AREAMOD_JUMP = new RcAreaModification(SAMPLE_POLYAREA_TYPE_JUMP, SAMPLE_POLYAREA_TYPE_JUMP); public const int SAMPLE_POLYFLAGS_WALK = 0x01; // Ability to walk (ground, grass, road) public const int SAMPLE_POLYFLAGS_SWIM = 0x02; // Ability to swim (water). diff --git a/test/DotRecast.Detour.Dynamic.Test/SampleAreaModifications.cs b/test/DotRecast.Detour.Dynamic.Test/SampleAreaModifications.cs index 42d9cb6..ad46f97 100644 --- a/test/DotRecast.Detour.Dynamic.Test/SampleAreaModifications.cs +++ b/test/DotRecast.Detour.Dynamic.Test/SampleAreaModifications.cs @@ -30,23 +30,12 @@ public class SampleAreaModifications public const int SAMPLE_POLYAREA_TYPE_GRASS = 0x5; public const int SAMPLE_POLYAREA_TYPE_JUMP = 0x6; - public static RcAreaModification SAMPLE_AREAMOD_GROUND = new RcAreaModification(SAMPLE_POLYAREA_TYPE_GROUND, - SAMPLE_POLYAREA_TYPE_MASK); - - public static RcAreaModification SAMPLE_AREAMOD_WATER = new RcAreaModification(SAMPLE_POLYAREA_TYPE_WATER, - SAMPLE_POLYAREA_TYPE_MASK); - - public static RcAreaModification SAMPLE_AREAMOD_ROAD = new RcAreaModification(SAMPLE_POLYAREA_TYPE_ROAD, - SAMPLE_POLYAREA_TYPE_MASK); - - public static RcAreaModification SAMPLE_AREAMOD_GRASS = new RcAreaModification(SAMPLE_POLYAREA_TYPE_GRASS, - SAMPLE_POLYAREA_TYPE_MASK); - - public static RcAreaModification SAMPLE_AREAMOD_DOOR = new RcAreaModification(SAMPLE_POLYAREA_TYPE_DOOR, - SAMPLE_POLYAREA_TYPE_DOOR); - - public static RcAreaModification SAMPLE_AREAMOD_JUMP = new RcAreaModification(SAMPLE_POLYAREA_TYPE_JUMP, - SAMPLE_POLYAREA_TYPE_JUMP); + public static readonly RcAreaModification SAMPLE_AREAMOD_GROUND = new RcAreaModification(SAMPLE_POLYAREA_TYPE_GROUND, SAMPLE_POLYAREA_TYPE_MASK); + public static readonly RcAreaModification SAMPLE_AREAMOD_WATER = new RcAreaModification(SAMPLE_POLYAREA_TYPE_WATER, SAMPLE_POLYAREA_TYPE_MASK); + public static readonly RcAreaModification SAMPLE_AREAMOD_ROAD = new RcAreaModification(SAMPLE_POLYAREA_TYPE_ROAD, SAMPLE_POLYAREA_TYPE_MASK); + public static readonly RcAreaModification SAMPLE_AREAMOD_GRASS = new RcAreaModification(SAMPLE_POLYAREA_TYPE_GRASS, SAMPLE_POLYAREA_TYPE_MASK); + public static readonly RcAreaModification SAMPLE_AREAMOD_DOOR = new RcAreaModification(SAMPLE_POLYAREA_TYPE_DOOR, SAMPLE_POLYAREA_TYPE_DOOR); + public static readonly RcAreaModification SAMPLE_AREAMOD_JUMP = new RcAreaModification(SAMPLE_POLYAREA_TYPE_JUMP, SAMPLE_POLYAREA_TYPE_JUMP); public const int SAMPLE_POLYFLAGS_WALK = 0x01; // Ability to walk (ground, grass, road) public const int SAMPLE_POLYFLAGS_SWIM = 0x02; // Ability to swim (water). diff --git a/test/DotRecast.Detour.Test/SampleAreaModifications.cs b/test/DotRecast.Detour.Test/SampleAreaModifications.cs index be6d2b2..a594a46 100644 --- a/test/DotRecast.Detour.Test/SampleAreaModifications.cs +++ b/test/DotRecast.Detour.Test/SampleAreaModifications.cs @@ -30,23 +30,12 @@ public class SampleAreaModifications public const int SAMPLE_POLYAREA_TYPE_GRASS = 0x5; public const int SAMPLE_POLYAREA_TYPE_JUMP = 0x6; - public static RcAreaModification SAMPLE_AREAMOD_GROUND = new RcAreaModification(SAMPLE_POLYAREA_TYPE_GROUND, - SAMPLE_POLYAREA_TYPE_MASK); - - public static RcAreaModification SAMPLE_AREAMOD_WATER = new RcAreaModification(SAMPLE_POLYAREA_TYPE_WATER, - SAMPLE_POLYAREA_TYPE_MASK); - - public static RcAreaModification SAMPLE_AREAMOD_ROAD = new RcAreaModification(SAMPLE_POLYAREA_TYPE_ROAD, - SAMPLE_POLYAREA_TYPE_MASK); - - public static RcAreaModification SAMPLE_AREAMOD_GRASS = new RcAreaModification(SAMPLE_POLYAREA_TYPE_GRASS, - SAMPLE_POLYAREA_TYPE_MASK); - - public static RcAreaModification SAMPLE_AREAMOD_DOOR = new RcAreaModification(SAMPLE_POLYAREA_TYPE_DOOR, - SAMPLE_POLYAREA_TYPE_DOOR); - - public static RcAreaModification SAMPLE_AREAMOD_JUMP = new RcAreaModification(SAMPLE_POLYAREA_TYPE_JUMP, - SAMPLE_POLYAREA_TYPE_JUMP); + public static readonly RcAreaModification SAMPLE_AREAMOD_GROUND = new RcAreaModification(SAMPLE_POLYAREA_TYPE_GROUND, SAMPLE_POLYAREA_TYPE_MASK); + public static readonly RcAreaModification SAMPLE_AREAMOD_WATER = new RcAreaModification(SAMPLE_POLYAREA_TYPE_WATER, SAMPLE_POLYAREA_TYPE_MASK); + public static readonly RcAreaModification SAMPLE_AREAMOD_ROAD = new RcAreaModification(SAMPLE_POLYAREA_TYPE_ROAD, SAMPLE_POLYAREA_TYPE_MASK); + public static readonly RcAreaModification SAMPLE_AREAMOD_GRASS = new RcAreaModification(SAMPLE_POLYAREA_TYPE_GRASS, SAMPLE_POLYAREA_TYPE_MASK); + public static readonly RcAreaModification SAMPLE_AREAMOD_DOOR = new RcAreaModification(SAMPLE_POLYAREA_TYPE_DOOR, SAMPLE_POLYAREA_TYPE_DOOR); + public static readonly RcAreaModification SAMPLE_AREAMOD_JUMP = new RcAreaModification(SAMPLE_POLYAREA_TYPE_JUMP, SAMPLE_POLYAREA_TYPE_JUMP); public const int SAMPLE_POLYFLAGS_WALK = 0x01; // Ability to walk (ground, grass, road) public const int SAMPLE_POLYFLAGS_SWIM = 0x02; // Ability to swim (water).