Skip to content

Commit fe4918f

Browse files
committed
Refactor
1 parent 7909078 commit fe4918f

File tree

20 files changed

+74
-83
lines changed

20 files changed

+74
-83
lines changed

Core/Game/Abilities/Essential/Move.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public bool GetFullCanCollisionStop ()
7272
public event Action OnStopMove;
7373

7474

75-
private LSBody cachedBody { get; set; }
75+
private LSBody_ cachedBody { get; set; }
7676

7777
private Turn CachedTurn { get; set; }
7878

@@ -450,7 +450,7 @@ protected override void OnStopCast ()
450450

451451
static LSAgent tempAgent;
452452

453-
private void HandleCollision (LSBody other)
453+
private void HandleCollision (LSBody_ other)
454454
{
455455

456456
if (!CanMove) {

Core/Game/Abilities/Essential/Scan.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ public virtual Vector3d[] ProjectileOffsets
143143
private Move cachedMove;
144144
private Turn cachedTurn;
145145

146-
protected LSBody cachedBody { get { return Agent.Body; } }
146+
protected LSBody_ cachedBody { get { return Agent.Body; } }
147147

148148
private int basePriority;
149149
private Health cachedTargetHealth;

Core/Game/Abilities/Essential/Turn.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public class Turn : Ability
1010
private Vector2d
1111
_turnRate = Vector2d.CreateRotation (FixedMath.One / 8);
1212
#endregion
13-
private LSBody Agent.Body;
13+
private LSBody_ Agent.Body;
1414
private bool targetReached;
1515
private Vector2d targetRotation;
1616
private long turnSin;
@@ -131,7 +131,7 @@ protected override void OnStopCast ()
131131
}
132132

133133

134-
private void HandleContact (LSBody other)
134+
private void HandleContact (LSBody_ other)
135135
{
136136
if (targetReached == true && Agent.IsCasting == false && !(Agent.Body.Immovable || Agent.Body.IsTrigger)) {
137137
Vector2d delta = this.Agent.Body._position - this.Agent.Body.LastPosition;

Core/Game/Agents/LSAgent.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public LSBusStop BusStop
104104
//[SerializeField]
105105
private UnityLSBody _unityBody;
106106
public UnityLSBody UnityBody {get {return _unityBody;}}
107-
public LSBody Body { get; set;}
107+
public LSBody_ Body { get; set;}
108108
//[SerializeField]
109109
private LSAnimatorBase _animator;
110110
public LSAnimatorBase Animator { get { return _animator; } }

Core/Game/Projectiles/LSProjectile.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ private bool CheckCollision()
316316
return CheckCollision(Target.Body);
317317
}
318318

319-
private bool CheckCollision(LSBody target)
319+
private bool CheckCollision(LSBody_ target)
320320
{
321321
return target._position.FastDistance(Position.x, Position.y) <= target.FastRadius;
322322
}
@@ -453,9 +453,9 @@ public void InitializeTimed(Vector2d forward)
453453
Direction = forward.ToVector3d();
454454
}
455455

456-
Func<LSBody, bool> BodyConditional;
456+
Func<LSBody_, bool> BodyConditional;
457457

458-
public void InitializeFree(Vector3d direction, Func<LSBody, bool> bodyConditional, bool useGravity = false)
458+
public void InitializeFree(Vector3d direction, Func<LSBody_, bool> bodyConditional, bool useGravity = false)
459459
{
460460
this.BodyConditional = bodyConditional;
461461
this.Direction = direction;
@@ -644,7 +644,7 @@ public void Setup(IProjectileData dataItem)
644644
}
645645
}
646646

647-
private FastList<LSBody> HitBodies = new FastList<LSBody>();
647+
private FastList<LSBody_> HitBodies = new FastList<LSBody_>();
648648

649649
public void Simulate()
650650
{
@@ -738,7 +738,7 @@ public void RaycastMove(Vector3d delta)
738738
Vector3d nextPosition = this.Position;
739739
nextPosition.Add(ref delta);
740740
HitBodies.FastClear();
741-
foreach (LSBody body in Raycaster.RaycastAll(this.Position, nextPosition))
741+
foreach (LSBody_ body in Raycaster.RaycastAll(this.Position, nextPosition))
742742
{
743743
if (this.BodyConditional(body))
744744
{

Core/Simulation/Grid/Influence/LSInfluencer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public class LSInfluencer
2828

2929
public GridNode LocatedNode { get; private set; }
3030

31-
public LSBody Body { get; private set; }
31+
public LSBody_ Body { get; private set; }
3232

3333
public LSAgent Agent { get; private set; }
3434

Core/Simulation/Grid/Utility/Tools/Blocker/Blocker.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
using Lockstep;
44

55
//Blocker for static environment pieces in a scene.
6-
[RequireComponent (typeof (LSBody))]
6+
[RequireComponent (typeof (LSBody_))]
77
public class Blocker : EnvironmentObject
88
{
99
static readonly FastList<Vector2d> bufferCoordinates = new FastList<Vector2d>();
@@ -13,13 +13,13 @@ public class Blocker : EnvironmentObject
1313
public bool BlockPathfinding {get {return _blockPathfinding;}}
1414

1515

16-
public LSBody CachedBody {get; private set;}
16+
public LSBody_ CachedBody {get; private set;}
1717

1818
protected override void OnLateInitialize()
1919
{
2020
base.OnInitialize();
2121

22-
CachedBody = this.GetComponent<LSBody> ();
22+
CachedBody = this.GetComponent<LSBody_> ();
2323

2424
if (this.BlockPathfinding) {
2525
const long gridSpacing = FixedMath.One;

Core/Simulation/Grid/Utility/Tools/Blocker/DynamicBlocker.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ public class DynamicBlocker : Ability
99
{
1010
static readonly FastList<Vector2d> bufferCoordinates = new FastList<Vector2d>();
1111

12-
LSBody CachedBody;
12+
LSBody_ CachedBody;
1313

1414
protected override void OnInitialize()
1515
{

Core/Simulation/Physics/Core/CollisionPair.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ namespace Lockstep
1111
{
1212
public class CollisionPair
1313
{
14-
public LSBody Body1;
15-
public LSBody Body2;
14+
public LSBody_ Body1;
15+
public LSBody_ Body2;
1616
private long CacheSqrDistance;
1717
private CollisionType LeCollisionType;
1818
private bool DoPhysics = true;
@@ -41,7 +41,7 @@ public bool IsColliding {
4141

4242
bool IsValid { get; set; }
4343

44-
public void Initialize(LSBody b1, LSBody b2)
44+
public void Initialize(LSBody_ b1, LSBody_ b2)
4545
{
4646
IsValid = true;
4747
if (!IsValid)
@@ -259,7 +259,7 @@ private void DistributeCollision()
259259

260260
}
261261

262-
void DistributeCircle_Poly(LSBody circle, LSBody poly)
262+
void DistributeCircle_Poly(LSBody_ circle, LSBody_ poly)
263263
{
264264
Vector2d edgeAxis = ClosestAxis.rotatedRight;
265265
long horProjection = circle._position.Dot(edgeAxis.x, edgeAxis.y);
@@ -469,7 +469,7 @@ public bool CheckBox()
469469
return false;
470470
}
471471

472-
public static bool CheckBox_Poly(LSBody box, LSBody poly)
472+
public static bool CheckBox_Poly(LSBody_ box, LSBody_ poly)
473473
{
474474
bool Right = poly._position.x > box._position.x;
475475
bool Top = poly._position.y > box._position.y;
@@ -525,7 +525,7 @@ public static bool CheckBox_Poly(LSBody box, LSBody poly)
525525
private static long ClosestAxisProjection;
526526

527527

528-
public static bool CheckCircle_Poly(LSBody circle, LSBody poly)
528+
public static bool CheckCircle_Poly(LSBody_ circle, LSBody_ poly)
529529
{
530530
int EdgeCount = poly.EdgeNorms.Length;
531531
ClosestDist = long.MaxValue;
@@ -577,7 +577,7 @@ public static bool CheckCircle_Poly(LSBody circle, LSBody poly)
577577
static bool Collided;
578578
static long xAbs, yAbs;
579579

580-
public void DistributeCircle_Box(LSBody box, LSBody circle)
580+
public void DistributeCircle_Box(LSBody_ box, LSBody_ circle)
581581
{
582582
xMore = circle._position.x > box._position.x;
583583
yMore = circle._position.y > box._position.y;
@@ -646,7 +646,7 @@ public void DistributeCircle_Box(LSBody box, LSBody circle)
646646
circle.BuildBounds();
647647
}
648648

649-
public static bool CheckCircle_Box(LSBody box, LSBody circle)
649+
public static bool CheckCircle_Box(LSBody_ box, LSBody_ circle)
650650
{
651651
Collided = false;
652652

@@ -714,7 +714,7 @@ public static bool CheckCircle_Box(LSBody box, LSBody circle)
714714
return Collided;
715715
}
716716

717-
public static bool CheckPoly_Poly(LSBody poly1, LSBody poly2)
717+
public static bool CheckPoly_Poly(LSBody_ poly1, LSBody_ poly2)
718718
{
719719
int Poly1EdgeCount = poly1.EdgeNorms.Length;
720720
int EdgeCount = Poly1EdgeCount + poly2.EdgeNorms.Length;
@@ -743,7 +743,7 @@ public static bool CheckPoly_Poly(LSBody poly1, LSBody poly2)
743743
return true;
744744
}
745745

746-
public static void ProjectPolygon(long AxisX, long AxisY, LSBody Poly, out long Min, out long Max)
746+
public static void ProjectPolygon(long AxisX, long AxisY, LSBody_ Poly, out long Min, out long Max)
747747
{
748748
Min = Poly.RealPoints[0].Dot(AxisX, AxisY);
749749
Max = Min;

Core/Simulation/Physics/Core/Editor/EditorLSBody.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ void OnSceneGUI()
166166
if (shape == ColliderType.None)
167167
return;
168168
Handles.color = Color.blue;
169-
LSBody Body = ((UnityLSBody)target).InternalBody;
169+
LSBody_ Body = ((UnityLSBody)target).InternalBody;
170170
Transform transform = ((UnityLSBody)target).transform;
171171
Vector3 targetPos = transform.position;
172172
const int ImprecisionLimit = 100000;

0 commit comments

Comments
 (0)