From 520df41715b334f8a3cae7aee4a6a9b2bdd8af0e Mon Sep 17 00:00:00 2001 From: mdb Date: Tue, 16 Oct 2001 17:11:07 +0000 Subject: [PATCH] Fixed bug in isValidPlacement(); added code to log reason for invalid placement; changed initFeatures() to inheritFeatures(). git-svn-id: https://samskivert.googlecode.com/svn/trunk@360 6335cc39-0255-0410-8fd6-9bcaacd3b74c --- .../java/com/samskivert/atlanti/util/TileUtil.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/projects/atlanti/src/java/com/samskivert/atlanti/util/TileUtil.java b/projects/atlanti/src/java/com/samskivert/atlanti/util/TileUtil.java index 69984d20..3d2dc216 100644 --- a/projects/atlanti/src/java/com/samskivert/atlanti/util/TileUtil.java +++ b/projects/atlanti/src/java/com/samskivert/atlanti/util/TileUtil.java @@ -1,5 +1,5 @@ // -// $Id: TileUtil.java,v 1.5 2001/10/16 09:31:46 mdb Exp $ +// $Id: TileUtil.java,v 1.6 2001/10/16 17:11:07 mdb Exp $ package com.threerings.venison; @@ -132,6 +132,8 @@ public class TileUtil implements TileCodes if (sum == 0) { // they overlap, nothing doing + Log.warning("Tile overlaps another [candidate=" + target + + ", overlapped=" + tile + "]."); return false; } else if (sum == 1) { @@ -144,6 +146,9 @@ public class TileUtil implements TileCodes // tile int tileEdge = (targetEdge+(4-tile.orientation)+2) % 4; + // now rotate the target edge according to our orientation + targetEdge = ((targetEdge+(4-target.orientation)) % 4); + // see if the edges match if (getEdge(tile.type, tileEdge) == getEdge(target.type, targetEdge)) { @@ -152,6 +157,10 @@ public class TileUtil implements TileCodes } else { // the edges don't match, nothing doing + Log.warning("Edge mismatch [candidate=" + target + + ", tile=" + tile + + ", candidateEdge=" + targetEdge + + ", tileEdge=" + tileEdge + "]."); return false; } } @@ -179,7 +188,7 @@ public class TileUtil implements TileCodes * not include the tile whose features are being configured). * @param tile the tile whose features should be configured. */ - public static void initClaims (VenisonTile[] tiles, VenisonTile tile) + public static void inheritClaims (VenisonTile[] tiles, VenisonTile tile) { // obtain our neighboring tiles VenisonTile[] neighbors = new VenisonTile[4];