internal static bool DetectCollission(IGameObject movingObject, IList <IGameObject> objectsToCheck, ref IList <IGameObject> colidedList) { bool isCollided = false; foreach (var obj in objectsToCheck) { if (!movingObject.Equals(obj)) { if (DoesIntersect(obj, movingObject)) { colidedList.Add(obj); isCollided = true; } } } return(isCollided); }
public bool IsCreator(IGameObject obj) { return(obj.Equals(Creator)); }
//check if a GameObject exists in the area public bool exists(IGameObject gameObject) { foreach (IGameObject gameObj in GameObjects) { if(gameObject.Equals(gameObj)){ return true; } } return false; }
private static bool equals(IGameObject gameObject1, IGameObject gameObject2) { return (gameObject1 == null && gameObject2 == null) || (gameObject1 != null && gameObject1.Equals(gameObject2)); }