Skip to content

Commit

Permalink
chore
Browse files Browse the repository at this point in the history
  • Loading branch information
Zonciu Liang committed Apr 22, 2019
1 parent 8e87752 commit 23d3ff6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
9 changes: 1 addition & 8 deletions src/Collision/Shapes/Shape.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,11 @@ public abstract class Shape
/// making rounded polygons.
public float Radius;

public ShapeType ShapeType;
public ShapeType ShapeType { get; internal set; }

/// Clone the concrete shape using the provided allocator.
public abstract Shape Clone();

/// Get the type of this shape. You can use this to down cast to the concrete shape.
/// @return the shape type.
public ShapeType GetShapeType()
{
return ShapeType;
}

/// Get the number of child primitives.
public abstract int GetChildCount();

Expand Down
3 changes: 2 additions & 1 deletion src/Dynamics/ContactManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ private Contact CreateContact(
Debug.Assert(0 <= type1 && type1 < ShapeType.TypeCount);
Debug.Assert(0 <= type2 && type2 < ShapeType.TypeCount);

var reg = _registers[(int) type1, (int) type2];
var reg = _registers[(int) type1, (int) type2]
?? throw new NullReferenceException($"{type1.ToString()} can not contact to {type2.ToString()}");
if (reg.Primary)
{
return reg.Factory.Create(fixtureA, indexA, fixtureB, indexB);
Expand Down

0 comments on commit 23d3ff6

Please sign in to comment.