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;
        }
Exemplo n.º 2
0
 public MapPoint(MapPoint point)
     : base(point.ToPoint())
 {
 }