public bool CheckCollision(IMovable source, MapPoint Destination) { if(source.Density < 1) return true; World currentworld = this.worldmanager.GetWorld(source.WorldName); foreach(MapHeader header in currentworld.Maps.Values) { Rectangle rect = (header.MapLocation).ToRect(header.Map.MapSize.ToPoint()); if(rect.Contains(Destination.ToPoint())) { return (header.Map.GetLayerValue(Destination - header.MapLocation, MapLayers.CollisionLayer) == -1); } } return true; }
public MapPoint(MapPoint point) : base(point.ToPoint()) { }