public Warp GetWarp(int x, int y) { for (int c = 0; c < Location.warps.Count; c++) { if (Location.warps[c].X == x && Location.warps[c].Y == y) { return(Warp.Wrap(Location.warps[c])); } } throw new NullReferenceException(); }
public bool TryGetWarp(int x, int y, out Warp warp) { warp = default(Warp); for (int c = 0; c < Location.warps.Count; c++) { if (Location.warps[c].X == x && Location.warps[c].Y == y) { warp = Warp.Wrap(Location.warps[c]); return(true); } } return(false); }