On 18.11.2012 14:15, Michael Vehrs wrote:
On 18.11.2012 12:29, Michael T. Pope wrote:
On Sun, 18 Nov 2012 09:07:06 AM Michael Vehrs wrote:
Wouldn't it be better if tiles recorded who claimed them, and possibly
also how they were claimed? Firstly, that would make the "next claimant"
code in csDisposeSettlement obsolete.
True, but existing code is `cheap', more per-tile storage less so.
Secondly, it would allow for
future extensions, such as claiming regions and actually owning them
after all previous claimants have been removed.
Region claims are an interesting idea, but surely to allow one you would have
to own all the settlements in the region? That is not a difficult thing to
test, and does not require more state in the Tile class.
I think the best argument for recording prior ownership is to allow a tile to
just revert to a previous owner, however the current next claimant code will
do that anyway in the majority of cases, as there are rarely more than two
possible tile owners to be found.
Alternatively, the "next claimant" code should be moved some place where
the map editor can use it.
That sounds simpler. For the map editor though, would it not be better to
just leave no owner?
Cheers,
Mike Pope
In the case of overlapping spheres of ownership, which are quite common
for cities, simply removing the ownership is not always the best idea.
Regards
Michael
As it turns out, csDisposeSettlement doesn't produce ideal results,
either, as you can easily check with the included patch. As far as the
map editor is concerned, I think placing two settlements with
overlapping territories and then removing one of them, should restore
the original territory of the remaining settlement.
Regards
Michael
Index: src/net/sf/freecol/client/gui/panel/EditSettlementDialog.java
===================================================================
--- src/net/sf/freecol/client/gui/panel/EditSettlementDialog.java (revision 10302)
+++ src/net/sf/freecol/client/gui/panel/EditSettlementDialog.java (working copy)
@@ -48,6 +48,8 @@
import net.sf.freecol.common.model.UnitType;
import net.sf.freecol.server.model.ServerUnit;
import net.sf.freecol.common.util.RandomChoice;
+import net.sf.freecol.server.control.ChangeSet;
+import net.sf.freecol.server.model.ServerPlayer;
/**
* This dialog is used to edit an Indian settlement (map editor only).
@@ -189,12 +191,15 @@
for (Unit unit : tile.getUnitList()) {
unit.dispose();
}
+ /*
tile.setSettlement(null);
tile.changeOwnership(null, null);
for (Tile owned : settlement.getOwnedTiles()) {
owned.changeOwnership(null, null);
}
settlement.dispose();
+ */
+ ((ServerPlayer) settlement.getOwner()).csDisposeSettlement(settlement, new ChangeSet());
}
getGUI().removeFromCanvas(this);
}
------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
_______________________________________________
Freecol-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freecol-developers