private static void InsertNode() { LinkedListNode <Ball> ballPos = ballList.Find(nodeBeingInserted); LinkedListNode <Ball> prev = ballPos.Previous; LinkedListNode <Ball> next = ballPos.Next; bool isTouching = false; if (prev != null && ballPos.Value.IsTouching(prev.Value)) { MoveNode(MoveType.Backward, prev); isTouching = true; } if (next != null && ballPos.Value.IsTouching(next.Value)) { MoveNode(MoveType.Forward, next); isTouching = true; } if (!isTouching) { CheckComb(nodeBeingInserted); GameStatusManager.Ready(); } }
public static void DestroyBall(Ball ball) { switch (ball.role) { case BallRole.Bullet: ball.Destroy(); GameStatusManager.Ready(); break; case BallRole.Follower: ball.Destroy(); break; } }