You can subscribe to this list here.
| 2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(12) |
Oct
(243) |
Nov
(138) |
Dec
(196) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2002 |
Jan
(74) |
Feb
(100) |
Mar
(198) |
Apr
(225) |
May
(27) |
Jun
(17) |
Jul
(6) |
Aug
(6) |
Sep
|
Oct
|
Nov
|
Dec
|
Update of /cvsroot/chaosrts/net/sourceforge/chaosrts/client/galaxy
In directory usw-pr-cvs1:/tmp/cvs-serv13101/sourceforge/chaosrts/client/galaxy
Modified Files:
GalaxyClient.java GameChooser.form GameChooser.java
JAVA.SOURCES OverviewMap.java
Added Files:
GalaxyObjectManager.java
Log Message:
fixed a lot of bug, improved unit movement/ scouting stuff, splited DiscoverdStuff and much more
--- NEW FILE: GalaxyObjectManager.java ---
/*
This file is part of Chaotic Domain, an advanced and highly
customizable real-time strategy game written in Java.
Copyright (C) 2002 Andreas Bauer
Chaotic Domain is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
Chaotic Domain is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Chaotic Domain; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
package net.sourceforge.chaosrts.client.galaxy;
import net.sourceforge.chaosrts.common.*;
import net.sourceforge.chaosrts.protocol.galaxy.*;
import net.sourceforge.chaosrts.server.galaxy.*;
import net.sourceforge.chaosrts.client.galaxy.engine.*;
import java.util.*;
/** This addes/removes/updates the GalaxyObjects in showen in the 3D engine
*
* @author andybauer
*/
public class GalaxyObjectManager {
GalaxyClient theClient;
Civilization myCiv;
Engine3D theEngine;
/** Creates a new instance of GalaxyObjectManager */
public GalaxyObjectManager(GalaxyClient theClient) {
this.theClient = theClient;
myCiv = theClient.myCiv;
theEngine = theClient.theEngine;
}
/** updates the Map,...
*
* @author andybauer
* @since 0.0.0pre2
*/
public void discoverdStuff(DiscoveredStuffPacket thePacket) {
//add new Grids to the World
Enumeration e = thePacket.newGrids.elements();
while(e.hasMoreElements()) {
GalaxyLocation tmp = (GalaxyLocation) e.nextElement();
if(tmp instanceof Grid) {
Grid tmp2 =(Grid) tmp;
theClient.currGroundSet[tmp2.X][tmp2.Y] = tmp2;
theEngine.addGrid(tmp2);
} else {
Sector tmp2 = (Sector)tmp;
theClient.spaceSet[tmp2.x][tmp2.y][tmp2.z] = tmp2;
if(theClient.currPlanet==null) {
//FIXME andybauer update 3D Engine
}
}
}
}
public void MGOUpdatePacket(MGOUpdatePacket thePacket) {
Vector objects = thePacket.mgo;
//Filter for dead enemy Units
Enumeration e = theClient.otherUnits.elements();
while(e.hasMoreElements()) {
MoveableGalaxyObject obj = (MoveableGalaxyObject) e.nextElement();
if(!objects.contains(obj)) {
theEngine.removeUnit(obj);
theClient.otherUnits.remove(obj);
} else {
theEngine.updateUnit(obj);
}
}
//Filter for dead owen Units
e = theClient.myUnits.elements();
while(e.hasMoreElements()) {
MoveableGalaxyObject obj = (MoveableGalaxyObject) e.nextElement();
if(!objects.contains(obj)) {
theEngine.removeUnit(obj);
theClient.myUnits.remove(obj);
}else {
theEngine.updateUnit(obj);
}
}
e = objects.elements();
while(e.hasMoreElements()) {
MoveableGalaxyObject unit = (MoveableGalaxyObject) e.nextElement();
if(unit.theCiv == myCiv) {
if(!theClient.myUnits.contains(unit)) {
theClient.myUnits.add(unit);
theEngine.addUnit(unit);
}
} else {
if(!theClient.otherUnits.contains(unit)) {
theClient.otherUnits.add(unit);
theEngine.addUnit(unit);
}
}
}
}
public void CityUpdatePacket(CityUpdatePacket thePacket) {
Enumeration e = theClient.myCities.elements();
while(e.hasMoreElements()) {
City city = (City) e.nextElement();
if(!thePacket.cities.contains(city)) {
theClient.myCities.remove(city);
//theEngine.removeCity(city); //FIXME andybauer add to Engine 3D
Vector toRemove = (Vector)theClient.myBuildings.get(city);
theClient.myBuildings.remove(city);
Enumeration eTmp = toRemove.elements();
while(eTmp.hasMoreElements()) {
Structure structure = (Structure) eTmp.nextElement();
toRemove.remove(structure);
theEngine.removeBuilding(structure,true);
}
}
}
e = theClient.otherCities.elements();
while(e.hasMoreElements()) {
City city = (City) e.nextElement();
if(!thePacket.cities.contains(city)) {
theClient.otherCities.remove(city);
//theEngine.removeCity(city); //FIXME andybauer add to Engine 3D
Vector toRemove = (Vector)theClient.otherBuildings.get(city);
theClient.otherBuildings.remove(city);
Enumeration eTmp = toRemove.elements();
while(eTmp.hasMoreElements()) {
Structure structure = (Structure) eTmp.nextElement();
toRemove.remove(structure);
theEngine.removeBuilding(structure,true);
}
}
}
e = thePacket.cities.elements();
while(e.hasMoreElements()) {
City city = (City) e.nextElement();
if(city.theCiv == myCiv) {
if(theClient.myCities.contains(city)) { //ok the city is alive, but maybe some buildings are destroyed
Vector currBuildings = (Vector) thePacket.structures.get(city);
Vector oldList = (Vector) theClient.myBuildings.get(city);
Enumeration eTmp = oldList.elements();
while(e.hasMoreElements()) {
Structure tmp = (Structure) e.nextElement();
if(!currBuildings.contains(tmp)) {
oldList.remove(tmp);
theEngine.removeBuilding(tmp,true);
}
}
eTmp = currBuildings.elements();
while(eTmp.hasMoreElements()) {
Structure tmp = (Structure) e.nextElement();
if(!oldList.contains(tmp)) {
oldList.add(tmp);
theEngine.addBuilding(tmp,true,true);
}
}
} else { //new city ...
theClient.myCities.add(city);
theEngine.addCity(city);
Vector toAdd = (Vector) thePacket.structures.get(city); // ... new buildings
Vector newBuildings = new Vector();
theClient.myBuildings.put(city,newBuildings);
newBuildings.addAll(toAdd);
Enumeration eTmp = toAdd.elements();
while(eTmp.hasMoreElements()) {
theEngine.addBuilding((Structure) e.nextElement(),true,true);
}
}
} else {
if(theClient.otherCities.contains(city)) {
Vector currBuildings = (Vector) thePacket.structures.get(city);
Vector oldList = (Vector) theClient.otherBuildings.get(city);
Enumeration eTmp = oldList.elements();
while(e.hasMoreElements()) {
Structure tmp = (Structure) e.nextElement();
if(!currBuildings.contains(tmp)) {
oldList.remove(tmp);
theEngine.removeBuilding(tmp,true);
}
}
eTmp = currBuildings.elements();
while(eTmp.hasMoreElements()) {
Structure tmp = (Structure) e.nextElement();
if(!oldList.contains(tmp)) {
oldList.add(tmp);
theEngine.addBuilding(tmp,false,false);
}
}
} else {
theClient.otherCities.add(city);
theEngine.addCity(city);
Vector toAdd = (Vector) thePacket.structures.get(city);
Vector newBuildings = new Vector();
theClient.otherBuildings.put(city,newBuildings);
newBuildings.addAll(toAdd);
Enumeration eTmp = toAdd.elements();
while(eTmp.hasMoreElements()) {
theEngine.addBuilding((Structure) e.nextElement(),false,false);
}
}
}
}
}
public void GroundStructuresUpdatePacket(GroundStructuresUpdatePacket thePacket){
Vector objects = thePacket.structures;
//Filter for dead enemy Units
Enumeration e = theClient.otherGroundBuildings.elements();
while(e.hasMoreElements()) {
GroundStructure obj = (GroundStructure) e.nextElement();
if(!objects.contains(obj)) {
//theEngine.removeGroundStructure(obj); //FIXME andybauer add to Engine 3D
theClient.otherGroundBuildings.remove(obj);
}
}
//Filter for dead owen Units
e = theClient.myGroundBuildings.elements();
while(e.hasMoreElements()) {
GroundStructure obj = (GroundStructure) e.nextElement();
if(!objects.contains(obj)) {
//theEngine.removeGroundStructure(obj); //FIXME andybauer add to Engine 3D
theClient.myGroundBuildings.remove(obj);
}
}
e = objects.elements();
while(e.hasMoreElements()) {
GroundStructure unit = (GroundStructure) e.nextElement();
if(unit.theCiv == myCiv) {
if(!theClient.myGroundBuildings.contains(unit)) {
theClient.myGroundBuildings.add(unit);
//theEngine.addGroundBuilding(unit); //FIXME andybauer add to Engine 3D
}
} else {
if(!theClient.otherGroundBuildings.contains(unit)) {
theClient.otherGroundBuildings.add(unit);
//theEngine.addGroundBuilding(unit); //FIXME andybauer add to Engine 3D
}
}
}
}
}
Index: GalaxyClient.java
===================================================================
RCS file: /cvsroot/chaosrts/net/sourceforge/chaosrts/client/galaxy/GalaxyClient.java,v
retrieving revision 1.82
retrieving revision 1.83
diff -C2 -d -r1.82 -r1.83
*** GalaxyClient.java 24 Jul 2002 10:00:29 -0000 1.82
--- GalaxyClient.java 14 Aug 2002 19:33:28 -0000 1.83
***************
*** 132,135 ****
--- 132,142 ----
public Engine3D theEngine;
+ /** The Galaxy Object Manager
+ *
+ *@author andybauer
+ *@since 0.0.0pre3
+ */
+ public GalaxyObjectManager goManager;
+
/** The Engine for Sound(Background)
*
***************
*** 192,195 ****
--- 199,209 ----
public ControlRights myRights;
+ /** The game info of the game
+ *
+ *@author andybauer
+ *@since 0.0.0pre3
+ */
+ public GameInfo gameInfo;
+
***************
*** 440,444 ****
* @since 0.0.0pre2
*/
! public Vector myBuildings = new Vector();
/** other Buildings on the current Planet/Space
--- 454,458 ----
* @since 0.0.0pre2
*/
! public Hashtable myBuildings = new Hashtable();
/** other Buildings on the current Planet/Space
***************
*** 447,466 ****
* @since 0.0.0pre2
*/
! public Vector otherBuildings = new Vector();
! /** Have we already joined in a game?
*
! * @author abdybauer
* @since 0.0.0pre2
*/
! public boolean joined = false;
! /** Currently shown cities
*
* @author andybauer
* @since 0.0.0pre2
*/
! public Vector currCities;
/** A vector with all clientPlugins
*
--- 461,502 ----
* @since 0.0.0pre2
*/
! public Hashtable otherBuildings = new Hashtable();
! /** my GroundBuldings on the current Planet/Space
*
! * @author andybauer
* @since 0.0.0pre2
*/
! public Vector myGroundBuildings = new Vector();
! /** other Ground uildings on the current Planet/Space
*
* @author andybauer
* @since 0.0.0pre2
*/
! public Vector otherGroundBuildings = new Vector();
+ /** my cities on the current Planet/Space
+ *
+ * @author andybauer
+ * @since 0.0.0pre2
+ */
+ public Vector myCities = new Vector();
+
+ /** other cities
+ *
+ * @author andybauer
+ * @since 0.0.0pre2
+ */
+ public Vector otherCities = new Vector();
+
+ /** Have we already joined in a game?
+ *
+ * @author abdybauer
+ * @since 0.0.0pre2
+ */
+ public boolean joined = false;
+
+
/** A vector with all clientPlugins
*
***************
*** 570,573 ****
--- 606,611 ----
}
+ goManager = new GalaxyObjectManager(this);
+
squadBuilder = new SquadBuilder(this,squadBuildableListModel);
***************
*** 1251,1255 ****
MoveableGalaxyObject obj = (MoveableGalaxyObject)selectedUnits.firstElement();
! theManager.sendPacket(new AssignMoveablePacket(serverRoute,obj,-1,0,0,null,MoveableGalaxyObject.STATUS_BUILDING,null,(GroundBuilding)groundBuildingList.getSelectedValue(),null));
}
--- 1289,1293 ----
MoveableGalaxyObject obj = (MoveableGalaxyObject)selectedUnits.firstElement();
! theManager.sendPacket(new AssignMoveablePacket(serverRoute,obj,MoveableGalaxyObject.STATUS_BUILDING,(GroundBuilding)groundBuildingList.getSelectedValue()));
}
***************
*** 1265,1269 ****
MoveableGalaxyObject obj = (MoveableGalaxyObject) e.nextElement();
! theManager.sendPacket(new AssignMoveablePacket(serverRoute,obj,-1,0,0,null,MoveableGalaxyObject.STATUS_FORTIFYING,null,null,null));
}
--- 1303,1307 ----
MoveableGalaxyObject obj = (MoveableGalaxyObject) e.nextElement();
! theManager.sendPacket(new AssignMoveablePacket(serverRoute,obj,MoveableGalaxyObject.STATUS_FORTIFYING));
}
***************
*** 1278,1282 ****
String name = JOptionPane.showInputDialog("The name for the new City");
MoveableGalaxyObject obj = (MoveableGalaxyObject)selectedUnits.firstElement();
! theManager.sendPacket(new AssignMoveablePacket(serverRoute,obj,-1,0,0,null,MoveableGalaxyObject.STATUS_CITY,name,null,null));
}
Enumeration plug = advantagedPlugins.elements();
--- 1316,1320 ----
String name = JOptionPane.showInputDialog("The name for the new City");
MoveableGalaxyObject obj = (MoveableGalaxyObject)selectedUnits.firstElement();
! theManager.sendPacket(new AssignMoveablePacket(serverRoute,obj,MoveableGalaxyObject.STATUS_CITY,name));
}
Enumeration plug = advantagedPlugins.elements();
***************
*** 1290,1294 ****
while(e.hasMoreElements()) {
MoveableGalaxyObject obj = (MoveableGalaxyObject) e.nextElement();
! theManager.sendPacket(new AssignMoveablePacket(serverRoute,obj,-1,0,0,null,MoveableGalaxyObject.STATUS_NOTHING,null,null,null));
}
--- 1328,1332 ----
while(e.hasMoreElements()) {
MoveableGalaxyObject obj = (MoveableGalaxyObject) e.nextElement();
! theManager.sendPacket(new AssignMoveablePacket(serverRoute,obj,MoveableGalaxyObject.STATUS_NOTHING));
}
***************
*** 1308,1311 ****
--- 1346,1352 ----
Technology res2 = (Technology) research2ComboBox.getSelectedItem();
theManager.sendPacket(new ChangeResearchPacket(serverRoute,res1,res2));
+ } else {
+ research1ComboBox.setSelectedItem(researching);
+ research2ComboBox.setSelectedItem(researchnext);
}
}
***************
*** 1319,1322 ****
--- 1360,1365 ----
government = (GovernmentType) govTypesComboBox.getSelectedItem();
theManager.sendPacket(new ChangeGovernmentPacket(serverRoute,government));
+ } else {
+ govTypesComboBox.setSelectedItem(government);
}
}
***************
*** 1451,1454 ****
--- 1494,1499 ----
theManager.sendPacket(new ChangeTaxesPacket(serverRoute,tax));
taxRate = tax;
+ } else {
+ taxTextField.setText(Short.toString(taxRate));
}
***************
*** 1485,1489 ****
currGroundSet = new Grid[newPlanet.width][newPlanet.height];
! currCities = (Vector) cities.get(currPlanet);
overviewMap.setMap(currGroundSet,true);
--- 1530,1534 ----
currGroundSet = new Grid[newPlanet.width][newPlanet.height];
! //currCities = (Vector) cities.get(currPlanet);
overviewMap.setMap(currGroundSet,true);
***************
*** 1491,1498 ****
theEngine.resetEngine(true, newPlanet.width,newPlanet.height,0);
! Enumeration e = currCities.elements();
while(e.hasMoreElements()) {
theEngine.addCity((City)e.nextElement());
! }
overviewMap.clearObjects();
--- 1536,1543 ----
theEngine.resetEngine(true, newPlanet.width,newPlanet.height,0);
! /*Enumeration e = currCities.elements();
while(e.hasMoreElements()) {
theEngine.addCity((City)e.nextElement());
! }*/
overviewMap.clearObjects();
***************
*** 1515,1519 ****
otherBuildings.clear();
myUnits.clear();
! otherBuildings.clear();
theManager.sendPacket(new SetViewedLocationPacket(currPlanet,serverRoute));
--- 1560,1568 ----
otherBuildings.clear();
myUnits.clear();
! otherUnits.clear();
! myGroundBuildings.clear();
! otherGroundBuildings.clear();
! myCities.clear();
! otherCities.clear();
theManager.sendPacket(new SetViewedLocationPacket(currPlanet,serverRoute));
***************
*** 1531,1535 ****
MoveableGalaxyObject obj = (MoveableGalaxyObject) e.nextElement();
! theManager.sendPacket(new AssignMoveablePacket(serverRoute,obj,x,y,0,currPlanet,MoveableGalaxyObject.STATUS_MOVING,null,null,null));
}
--- 1580,1584 ----
MoveableGalaxyObject obj = (MoveableGalaxyObject) e.nextElement();
! theManager.sendPacket(new AssignMoveablePacket(serverRoute,obj,MoveableGalaxyObject.STATUS_MOVING,x,y,0,currPlanet));
}
***************
*** 1638,1643 ****
productionCompleted((ProductionCompleteAlert) thePacket);
} else if(thePacket instanceof DiscoveredStuffPacket) {
! discoverdStuff((DiscoveredStuffPacket) thePacket);
! } else if(thePacket instanceof GalaxyDataPacket) {
showGameChooseDialog((GalaxyDataPacket) thePacket);
} else if(thePacket instanceof YourCivPacket) {
--- 1687,1698 ----
productionCompleted((ProductionCompleteAlert) thePacket);
} else if(thePacket instanceof DiscoveredStuffPacket) {
! goManager.discoverdStuff((DiscoveredStuffPacket) thePacket);
! } else if(thePacket instanceof MGOUpdatePacket) {
! goManager.MGOUpdatePacket((MGOUpdatePacket) thePacket);
! }else if(thePacket instanceof CityUpdatePacket) {
! goManager.CityUpdatePacket((CityUpdatePacket) thePacket);
! }else if(thePacket instanceof GroundStructuresUpdatePacket) {
! goManager.GroundStructuresUpdatePacket((GroundStructuresUpdatePacket) thePacket);
! }else if(thePacket instanceof GalaxyDataPacket) {
showGameChooseDialog((GalaxyDataPacket) thePacket);
} else if(thePacket instanceof YourCivPacket) {
***************
*** 1849,1855 ****
prodListModels.put(thePacket.theCity,new DefaultListModel());
! if(((Grid)tmp.theLoc).thePlanet==currPlanet) {
theEngine.addCity(tmp);
! }
}
--- 1904,1911 ----
prodListModels.put(thePacket.theCity,new DefaultListModel());
! /*if(((Grid)tmp.theLoc).thePlanet==currPlanet) { //FIXME should not needed, as the city is added during UnitEngine run
theEngine.addCity(tmp);
! myCities.add(tmp);
! }*/
}
***************
*** 1885,1889 ****
} catch(Exception e) {}
! if(((Grid)produced.theLoc).thePlanet==currPlanet) { //FIXME andybauer Don't you want to check if this is in space?
if(produced instanceof Structure) {
myBuildings.add(produced);
--- 1941,1945 ----
} catch(Exception e) {}
! /* if(((Grid)produced.theLoc).thePlanet==currPlanet) { //FIXME andybauer Don't you want to check if this is in space?
if(produced instanceof Structure) {
myBuildings.add(produced);
***************
*** 1896,2031 ****
}
} else if(/* //FIXME andybauer It used to be this; I changed it: produced.theSector==null) {*/
! !(produced.theLoc instanceof Sector)) {
//will not be cached
} else {
//FIXME andybauer add stuff
}
! overviewMap.repaint();
}
! /** updates the Map,...
! *
! * @author andybauer
! * @since 0.0.0pre2
! */
! private void discoverdStuff(DiscoveredStuffPacket thePacket) {
!
!
! //add new Grids to the World
! Enumeration e = thePacket.newGrids.elements();
! while(e.hasMoreElements()) {
! GalaxyLocation tmp = (GalaxyLocation) e.nextElement();
! if(tmp instanceof Grid) {
! Grid tmp2 =(Grid) tmp;
! currGroundSet[tmp2.X][tmp2.Y] = tmp2;
! theEngine.addGrid(tmp2);
! } else {
! Sector tmp2 = (Sector)tmp;
! spaceSet[tmp2.x][tmp2.y][tmp2.z] = tmp2;
! if(currPlanet==null) {
! //FIXME andybauer update 3D Engine
! }
! }
! }
!
!
!
! Vector objects = thePacket.galaxyObjects;
!
! //Filter for dead enemy Units
! e = otherUnits.elements();
! while(e.hasMoreElements()) {
! MoveableGalaxyObject obj = (MoveableGalaxyObject) e.nextElement();
! if(!objects.contains(obj)) {
! theEngine.removeUnit(obj);
! otherUnits.remove(obj);
! overviewMap.removeObject(obj);
! }
! }
!
! //Filter for dead owen Units
! e = myUnits.elements();
! while(e.hasMoreElements()) {
! MoveableGalaxyObject obj = (MoveableGalaxyObject) e.nextElement();
! if(!objects.contains(obj)) {
! theEngine.removeUnit(obj);
! myUnits.remove(obj);
! overviewMap.removeObject(obj);
! }
! }
!
! //The same for buildings again
!
! e = otherBuildings.elements();
! while(e.hasMoreElements()) {
! Structure obj = (Structure) e.nextElement();
! if(!objects.contains(obj)) {
! //theEngine.removeBuilding(obj); //FIXME andybauer fog building
! otherBuildings.remove(obj);
! overviewMap.removeObject(obj);
! }
! }
! //The same for my buildings again
!
! e = myBuildings.elements();
! while(e.hasMoreElements()) {
! Structure obj = (Structure) e.nextElement();
! if(!objects.contains(obj)) {
! theEngine.removeBuilding(obj,false); //FIXME andybauer fog building
! myBuildings.remove(obj);
! overviewMap.removeObject(obj);
! }
! }
!
! //Now we are filtering for new Units/Buildings
! e = objects.elements();
!
! while(e.hasMoreElements()) {
!
!
! GalaxyObject obj = (GalaxyObject) e.nextElement();
!
! if(obj instanceof Structure) { //its a building
! Structure building = (Structure) obj;
! if(building.theCiv == myCiv) {
! if(!myBuildings.contains(building)) {
! myBuildings.add(building);
! theEngine.addBuilding(building,true,false);
! overviewMap.addObject(building);
! }
! } else {
! if(!otherBuildings.contains(building)) {
! otherBuildings.add(building);
! theEngine.addBuilding(building,false,false);
! overviewMap.addObject(building);
! }
! }
! }
!
! else {
! MoveableGalaxyObject unit = (MoveableGalaxyObject) obj;
!
! if(unit.theCiv == myCiv) {
! if(!myUnits.contains(unit)) {
! myUnits.add(unit);
! theEngine.addUnit(unit);
!
! overviewMap.addObject(unit);
! }
! } else {
! if(!otherUnits.contains(unit)) {
! otherUnits.add(unit);
! theEngine.addUnit(unit);
! overviewMap.addObject(unit);
! }
! }
! }
!
! }
!
! //overviewMap.repaint(); //FIXME andybauer repair OverviewMap and remove this
!
!
! }
private void deadUnitUpdate(DeadUnitUpdatePacket thePacket) {
--- 1952,1964 ----
}
} else if(/* //FIXME andybauer It used to be this; I changed it: produced.theSector==null) {*/
! /* !(produced.theLoc instanceof Sector)) {
//will not be cached
} else {
//FIXME andybauer add stuff
}
! overviewMap.repaint();*/
}
!
private void deadUnitUpdate(DeadUnitUpdatePacket thePacket) {
Index: GameChooser.form
===================================================================
RCS file: /cvsroot/chaosrts/net/sourceforge/chaosrts/client/galaxy/GameChooser.form,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** GameChooser.form 28 Feb 2002 20:26:17 -0000 1.4
--- GameChooser.form 14 Aug 2002 19:33:29 -0000 1.5
***************
*** 17,30 ****
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout"/>
<SubComponents>
- <Component class="javax.swing.JLabel" name="infoLabel">
- <Properties>
- <Property name="text" type="java.lang.String" value="Test Info"/>
- </Properties>
- <Constraints>
- <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
- <GridBagConstraints gridX="-1" gridY="-1" gridWidth="2" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="1.0" weightY="0.0"/>
- </Constraint>
- </Constraints>
- </Component>
<Component class="javax.swing.JList" name="civList">
<Properties>
--- 17,20 ----
***************
*** 101,104 ****
--- 91,129 ----
</Constraints>
</Component>
+ <Container class="javax.swing.JPanel" name="jPanel2">
+ <Constraints>
+ <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
+ <GridBagConstraints gridX="-1" gridY="-1" gridWidth="2" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="1.0" weightY="0.0"/>
+ </Constraint>
+ </Constraints>
+
+ <Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout"/>
+ <SubComponents>
+ <Component class="javax.swing.JLabel" name="infoLabel">
+ <Properties>
+ <Property name="text" type="java.lang.String" value="Test Info"/>
+ </Properties>
+ <Constraints>
+ <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
+ <GridBagConstraints gridX="-1" gridY="-1" gridWidth="1" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="1.0" weightY="0.0"/>
+ </Constraint>
+ </Constraints>
+ </Component>
+ <Component class="javax.swing.JButton" name="moreInfoButton">
+ <Properties>
+ <Property name="text" type="java.lang.String" value="..."/>
+ </Properties>
+
+ <Events>
+ <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="moreInfoButtonActionPerformed"/>
+ </Events>
+ <Constraints>
+ <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
+ <GridBagConstraints gridX="1" gridY="0" gridWidth="1" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/>
+ </Constraint>
+ </Constraints>
+ </Component>
+ </SubComponents>
+ </Container>
</SubComponents>
</Container>
Index: GameChooser.java
===================================================================
RCS file: /cvsroot/chaosrts/net/sourceforge/chaosrts/client/galaxy/GameChooser.java,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** GameChooser.java 18 Apr 2002 23:33:58 -0000 1.19
--- GameChooser.java 14 Aug 2002 19:33:29 -0000 1.20
***************
*** 55,59 ****
--- 55,61 ----
initComponents();
+ theClient.gameInfo = thePacket.theInfo;
+ infoLabel.setText(thePacket.theInfo.description);
DefaultListModel civ = new DefaultListModel();
***************
*** 80,85 ****
new ChaosMenuBar(theFrame);
theFrame.setSize(640,480);
! // theFrame.setExtendedState(JFrame.MAXIMIZED_BOTH);
! //FIXME andybuaer the commented out line gave problems with JDK 1.3
theFrame.getContentPane().removeAll();
theFrame.getContentPane().add(this);
--- 82,86 ----
new ChaosMenuBar(theFrame);
theFrame.setSize(640,480);
!
theFrame.getContentPane().removeAll();
theFrame.getContentPane().add(this);
***************
*** 100,104 ****
jPanel1 = new javax.swing.JPanel();
- infoLabel = new javax.swing.JLabel();
civList = new javax.swing.JList();
contrList = new javax.swing.JList();
--- 101,104 ----
***************
*** 106,109 ****
--- 106,112 ----
cancelButton = new javax.swing.JButton();
newCivButton = new javax.swing.JButton();
+ jPanel2 = new javax.swing.JPanel();
+ infoLabel = new javax.swing.JLabel();
+ moreInfoButton = new javax.swing.JButton();
setLayout(new java.awt.BorderLayout());
***************
*** 111,121 ****
jPanel1.setLayout(new java.awt.GridBagLayout());
- infoLabel.setText("Test Info");
- gridBagConstraints = new java.awt.GridBagConstraints();
- gridBagConstraints.gridwidth = 2;
- gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
- gridBagConstraints.weightx = 1.0;
- jPanel1.add(infoLabel, gridBagConstraints);
-
civList.setBorder(new javax.swing.border.TitledBorder("Civilizations"));
civList.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
--- 114,117 ----
***************
*** 179,186 ****
--- 175,213 ----
jPanel1.add(newCivButton, gridBagConstraints);
+ jPanel2.setLayout(new java.awt.GridBagLayout());
+
+ infoLabel.setText("Test Info");
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
+ gridBagConstraints.weightx = 1.0;
+ jPanel2.add(infoLabel, gridBagConstraints);
+
+ moreInfoButton.setText("...");
+ moreInfoButton.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ moreInfoButtonActionPerformed(evt);
+ }
+ });
+
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 1;
+ gridBagConstraints.gridy = 0;
+ gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
+ jPanel2.add(moreInfoButton, gridBagConstraints);
+
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridwidth = 2;
+ gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
+ gridBagConstraints.weightx = 1.0;
+ jPanel1.add(jPanel2, gridBagConstraints);
+
add(jPanel1, java.awt.BorderLayout.CENTER);
}//GEN-END:initComponents
+ private void moreInfoButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_moreInfoButtonActionPerformed
+ // Add your handling code here:
+ }//GEN-LAST:event_moreInfoButtonActionPerformed
+
private void newCivButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_newCivButtonActionPerformed
NewCivDialog dialog = new NewCivDialog();
***************
*** 192,196 ****
private void cancelButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancelButtonActionPerformed
! theClient.disconnect();
}//GEN-LAST:event_cancelButtonActionPerformed
--- 219,223 ----
private void cancelButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancelButtonActionPerformed
! //FIXME display a dialog with more infos
}//GEN-LAST:event_cancelButtonActionPerformed
***************
*** 245,249 ****
--- 272,278 ----
private javax.swing.JList contrList;
private javax.swing.JButton joinButton;
+ private javax.swing.JPanel jPanel2;
private javax.swing.JPanel jPanel1;
+ private javax.swing.JButton moreInfoButton;
private javax.swing.JLabel infoLabel;
private javax.swing.JButton newCivButton;
Index: JAVA.SOURCES
===================================================================
RCS file: /cvsroot/chaosrts/net/sourceforge/chaosrts/client/galaxy/JAVA.SOURCES,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -d -r1.22 -r1.23
*** JAVA.SOURCES 21 Jun 2002 05:58:46 -0000 1.22
--- JAVA.SOURCES 14 Aug 2002 19:33:29 -0000 1.23
***************
*** 13,14 ****
--- 13,15 ----
AdvancedClientPlugin.java
ClientPlugin.java
+ GalaxyObjectManager.java
Index: OverviewMap.java
===================================================================
RCS file: /cvsroot/chaosrts/net/sourceforge/chaosrts/client/galaxy/OverviewMap.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** OverviewMap.java 26 Apr 2002 07:59:33 -0000 1.11
--- OverviewMap.java 14 Aug 2002 19:33:29 -0000 1.12
***************
*** 217,221 ****
System.out.println("Map: Clicked at: x "+Integer.toString(posx)+" y "+Integer.toString(posy));
}
! theClient.gridPicked((Grid)map[posx][posy]);
}
--- 217,221 ----
System.out.println("Map: Clicked at: x "+Integer.toString(posx)+" y "+Integer.toString(posy));
}
! //theClient.gridPicked((Grid)map[posx][posy]);
}
|
Update of /cvsroot/chaosrts/net/sourceforge/chaosrts/server/galaxy
In directory usw-pr-cvs1:/tmp/cvs-serv13101/sourceforge/chaosrts/server/galaxy
Modified Files:
Civilization.java Controller.java DefaultPlugin.java
GalaxyServer.java ParentEngine.java PathFinder.java
Log Message:
fixed a lot of bug, improved unit movement/ scouting stuff, splited DiscoverdStuff and much more
Index: Civilization.java
===================================================================
RCS file: /cvsroot/chaosrts/net/sourceforge/chaosrts/server/galaxy/Civilization.java,v
retrieving revision 1.101
retrieving revision 1.102
diff -C2 -d -r1.101 -r1.102
*** Civilization.java 21 Jun 2002 05:58:47 -0000 1.101
--- Civilization.java 14 Aug 2002 19:33:31 -0000 1.102
***************
*** 2,22 ****
This file is part of Chaotic Domain, an advanced and highly
customizable real-time strategy game written in Java.
!
Copyright (C) 2001 Michael Snoyman, Andreas Bauer
!
Chaotic Domain is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
!
[...1956 lines suppressed...]
! pop=true;
}
}
***************
*** 1241,1247 ****
*/
public TrainingClass(int howmany,TrainingCourse thecourse) {
! theCourse=thecourse;
! howMany=howmany;
! cycles=theCourse.getYears()*GalaxyServer.civLoops;
}
}
--- 1315,1321 ----
*/
public TrainingClass(int howmany,TrainingCourse thecourse) {
! theCourse=thecourse;
! howMany=howmany;
! cycles=theCourse.getYears()*GalaxyServer.civLoops;
}
}
Index: Controller.java
===================================================================
RCS file: /cvsroot/chaosrts/net/sourceforge/chaosrts/server/galaxy/Controller.java,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -d -r1.22 -r1.23
*** Controller.java 23 Apr 2002 03:21:45 -0000 1.22
--- Controller.java 14 Aug 2002 19:33:31 -0000 1.23
***************
*** 31,35 ****
*@since 0.0.0pre2
*/
! public class Controller extends ChaosObject {
/**Nickname of the controller.
*
--- 31,35 ----
*@since 0.0.0pre2
*/
! public class Controller extends ChaosObject { //FIXME should this be ReadOnly
/**Nickname of the controller.
*
Index: DefaultPlugin.java
===================================================================
RCS file: /cvsroot/chaosrts/net/sourceforge/chaosrts/server/galaxy/DefaultPlugin.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** DefaultPlugin.java 22 Apr 2002 06:14:00 -0000 1.16
--- DefaultPlugin.java 14 Aug 2002 19:33:31 -0000 1.17
***************
*** 163,167 ****
--- 163,169 ----
}
class UnitMover extends EngineListener {
+
public void run(ParentEngine pe) {
+ MoveableGalaxyObject.lastUnitEngineRun = System.currentTimeMillis();
for(int i=0;i<pe.theServer.civs.length;i++)
pe.theServer.civs[i].unitMover();
Index: GalaxyServer.java
===================================================================
RCS file: /cvsroot/chaosrts/net/sourceforge/chaosrts/server/galaxy/GalaxyServer.java,v
retrieving revision 1.68
retrieving revision 1.69
diff -C2 -d -r1.68 -r1.69
*** GalaxyServer.java 21 Jun 2002 05:58:47 -0000 1.68
--- GalaxyServer.java 14 Aug 2002 19:33:31 -0000 1.69
***************
*** 242,245 ****
--- 242,246 ----
totalSystems=Math.min(totalSystems,totalSectors/3);
totalSystems=Math.max(totalSystems,1); //Yes, we need 1 system at least
+ System.out.println("Total Systems: "+totalSystems);
systems=new StarSystem[totalSystems];
for(int i=0;i<totalSystems;i++) {
Index: ParentEngine.java
===================================================================
RCS file: /cvsroot/chaosrts/net/sourceforge/chaosrts/server/galaxy/ParentEngine.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** ParentEngine.java 15 Apr 2002 19:18:09 -0000 1.11
--- ParentEngine.java 14 Aug 2002 19:33:31 -0000 1.12
***************
*** 36,40 ****
*/
public class ParentEngine implements Runnable {
! public ParentEngine() {} //Added so that Class.newInstance can be used
/**Class the keeps starting new Thread's to handle this ParentEngine.
*
--- 36,40 ----
*/
public class ParentEngine implements Runnable {
! public ParentEngine() {} //Added so that Class.newInstance can be used //FIXME do we need this?
/**Class the keeps starting new Thread's to handle this ParentEngine.
*
***************
*** 110,115 ****
*/
public void iterate() {
! (new Thread(this)).start();
! //run();
}
public void run() {
--- 110,115 ----
*/
public void iterate() {
! //(new Thread(this)).start();
! run(); //FIXME andybauer add a debug propertie for this
}
public void run() {
***************
*** 171,174 ****
*@since 0.0.0pre2
*/
! int delay;
}
--- 171,175 ----
*@since 0.0.0pre2
*/
! public int delay;
!
}
Index: PathFinder.java
===================================================================
RCS file: /cvsroot/chaosrts/net/sourceforge/chaosrts/server/galaxy/PathFinder.java,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** PathFinder.java 21 Jun 2002 07:26:01 -0000 1.18
--- PathFinder.java 14 Aug 2002 19:33:31 -0000 1.19
***************
*** 353,357 ****
}
catch(DoneProcessing e) {
! e.printStackTrace();
} //Not a problem, just means I'm done processing
}
--- 353,358 ----
}
catch(DoneProcessing e) {
! //e.printStackTrace();
! System.out.println("Found path");
} //Not a problem, just means I'm done processing
}
|
|
From: Andreas B. <and...@us...> - 2002-08-14 19:33:35
|
Update of /cvsroot/chaosrts/net/sourceforge/chaosrts/simpleclient
In directory usw-pr-cvs1:/tmp/cvs-serv13101/sourceforge/chaosrts/simpleclient
Modified Files:
SimpleGalaxyClient.java
Log Message:
fixed a lot of bug, improved unit movement/ scouting stuff, splited DiscoverdStuff and much more
Index: SimpleGalaxyClient.java
===================================================================
RCS file: /cvsroot/chaosrts/net/sourceforge/chaosrts/simpleclient/SimpleGalaxyClient.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** SimpleGalaxyClient.java 21 Jun 2002 05:58:48 -0000 1.14
--- SimpleGalaxyClient.java 14 Aug 2002 19:33:31 -0000 1.15
***************
*** 327,331 ****
destGrid,
MoveableGalaxyObject.STATUS_MOVING,
! null,null,null));
}
});
--- 327,331 ----
destGrid,
MoveableGalaxyObject.STATUS_MOVING,
! null,null));
}
});
***************
*** 345,349 ****
if(index==-1) //Don't build
return;
! theManager.sendPacket(new AssignMoveablePacket(serverRoute,theSett,selectedGrid.theGrid,MoveableGalaxyObject.STATUS_BUILDING,null,(GroundBuilding)gb.get(index),null));
}//GEN-LAST:event_buildGroundBuildingButtonActionPerformed
--- 345,349 ----
if(index==-1) //Don't build
return;
! theManager.sendPacket(new AssignMoveablePacket(serverRoute,theSett,selectedGrid.theGrid,MoveableGalaxyObject.STATUS_BUILDING,null,(GroundBuilding)gb.get(index)));
}//GEN-LAST:event_buildGroundBuildingButtonActionPerformed
***************
*** 360,369 ****
String cityName=(new TextInputDialog(this,"Enter the name of the new city")).getInput();
! Vector cityGrids=new Vector(); //FIXME Get Grid's for the city
! cityGrids.add(selectedGrid.theGrid);
//Found a Settler; give it the build city command and exit
theManager.sendPacket(new AssignMoveablePacket( //cont...
! serverRoute,theSett,selectedGrid.theGrid,MoveableGalaxyObject.STATUS_CITY,cityName,null,cityGrids));
return;
}
--- 360,369 ----
String cityName=(new TextInputDialog(this,"Enter the name of the new city")).getInput();
!
!
//Found a Settler; give it the build city command and exit
theManager.sendPacket(new AssignMoveablePacket( //cont...
! serverRoute,theSett,selectedGrid.theGrid,MoveableGalaxyObject.STATUS_CITY,cityName,null));
return;
}
|
|
From: Andreas B. <and...@us...> - 2002-08-14 19:33:34
|
Update of /cvsroot/chaosrts/net/sourceforge/chaosrts/common
In directory usw-pr-cvs1:/tmp/cvs-serv13101/sourceforge/chaosrts/common
Modified Files:
Building.java ChaosTree.java City.java GalaxyObject.java
GroundStructure.java MoveableGalaxyObject.java Planet.java
ProductionTemplate.java Settler.java Squad.java Structure.java
UnitDesign.java
Log Message:
fixed a lot of bug, improved unit movement/ scouting stuff, splited DiscoverdStuff and much more
Index: Building.java
===================================================================
RCS file: /cvsroot/chaosrts/net/sourceforge/chaosrts/common/Building.java,v
retrieving revision 1.38
retrieving revision 1.39
diff -C2 -d -r1.38 -r1.39
*** Building.java 14 May 2002 15:21:24 -0000 1.38
--- Building.java 14 Aug 2002 19:33:30 -0000 1.39
***************
*** 127,136 ****
}
! public GalaxyLocation getPlacedLocation(City builtLocation) {
! if(((Grid)builtLocation.theLoc).hasRoomForBuilding(getWidth(),getHeight(),onWater)) //Room inside city, build there
! return builtLocation.theLoc;
! //Outside city
! return GalaxyObject.getLocationOutsideCity(builtLocation,onWater,getWidth(),getHeight());
! }
public GalaxyObject makeNew(Civilization theciv) {
return new Structure(this,theciv);
--- 127,131 ----
}
!
public GalaxyObject makeNew(Civilization theciv) {
return new Structure(this,theciv);
Index: ChaosTree.java
===================================================================
RCS file: /cvsroot/chaosrts/net/sourceforge/chaosrts/common/ChaosTree.java,v
retrieving revision 1.51
retrieving revision 1.52
diff -C2 -d -r1.51 -r1.52
*** ChaosTree.java 24 Jul 2002 10:00:29 -0000 1.51
--- ChaosTree.java 14 Aug 2002 19:33:30 -0000 1.52
***************
*** 27,31 ****
import java.util.*;
import java.io.*;
- //import javax.swing.*;
/**Information on the chaos tree.
--- 27,30 ----
Index: City.java
===================================================================
RCS file: /cvsroot/chaosrts/net/sourceforge/chaosrts/common/City.java,v
retrieving revision 1.33
retrieving revision 1.34
diff -C2 -d -r1.33 -r1.34
*** City.java 26 Apr 2002 07:59:34 -0000 1.33
--- City.java 14 Aug 2002 19:33:30 -0000 1.34
***************
*** 150,153 ****
--- 150,208 ----
return true;
}
+
+ /** find a free place for a Structure
+ *
+ *@author andybauer
+ *@since 0.0.0pre3
+ */
+ public Grid getFreeLocation(Structure tmp) {
+ //FIXME implement me!
+ //when found, the place should also reserved, i.e SpaceAvailible decremented,...
+ return (Grid) theLoc;
+
+ }
+ /**Find the nearest location to the given City, whether or not on water.
+ *
+ *@author LiChaimGuy
+ *@since 0.0.0pre2
+ *@param builtLocation City this is built in.
+ *@param onWater Whether or not to build on water (if false, build on any kind of land)
+ *@returns the place location, or null if it couldn't placed
+ */
+ public GalaxyLocation getLocationOutsideCity(City builtLocation,boolean onWater) {
+
+ GalaxyLocation location = null;
+
+ Enumeration e = theGrids.elements();
+
+ byte[][] round = {{0,-1},{1,0},{0,1},{-1,0},{-1,-1},{1,-1},{1,1},{-1,1}};
+
+ stop: {
+ while(e.hasMoreElements()) {
+ Grid tmp = (Grid) e.nextElement();
+ int x = tmp.X;
+ int y = tmp.Y;
+ for(int i = 0;i<8;i++) {
+ Grid inspect = tmp.thePlanet.map[x+round[i][0]][y+round[i][1]];
+ if(!(inspect.occupier instanceof City) && inspect.type.isWater==onWater) {
+ location = inspect;
+ break stop;
+ }
+ }
+ }
+ }
+
+ return location;
+ }
+ /**extands the city
+ *
+ *@author andybauer
+ *@since 0.0.0pre3
+ */
+ private void extandCity() {
+ //FIXME implement this
+
+ }
+
/**A Vector of all Grid's that this City rests on.*/
public Vector theGrids;
***************
*** 163,204 ****
*@since 0.0.0pre2
*@param theciv Civilization that owns this.
! *@param grids Vector of all Grid's this City will encompass
*/
! public City(Civilization theciv,Vector grids) {
theCiv=theciv;
! theGrids=grids;
! theLoc=(Grid)theGrids.firstElement();
theCiv.cities.add(this);
! spaceAvailable=grids.size()*16; //The 16 factor is because 16 building grids fit in 1 map grid (inside a city).
queue=new Vector();
! //Setup the default building
! //Structure s=(Structure)ChaosTree.theChaosTree.defaultBuilding.makeNew(theCiv);
! //s.benefits=new Benefits();
! //s.placeInsideCity(this);
! //moved to Settler#move()
!
! }
! public void removeOldLocation(boolean changingPlanets) {
! //FIXME Do this
}
public void destroyed() {
theCiv.cities.remove(this);
! Enumeration e=theGrids.elements();
while(e.hasMoreElements()) {
((Grid)e.nextElement()).occupier=null;
}
}
public void scoutLand(Vector grids,Vector sectorsToScout) {
! //Find out the longest-ranged building in this city.
! int range=-1;
! Enumeration e=buildings.elements();
! while(e.hasMoreElements()) {
! Structure s=(Structure)e.nextElement();
! range=Math.max(range,s.theBuilding.radar);
! }
!
! getScoutedGrids(grids,theGrids,range);
}
public void writeObject(ChaosStream out) throws java.io.IOException {
--- 218,254 ----
*@since 0.0.0pre2
*@param theciv Civilization that owns this.
! *@param grid starting Grid of the City
*/
! public City(Civilization theciv,Grid grid) {
theCiv=theciv;
! theGrids = new Vector();
! theGrids.add(grid);
! setLocation(grid,true);
theCiv.cities.add(this);
! spaceAvailable=16; //It's 16 because 16 building grids fit in 1 map grid (inside a city).
queue=new Vector();
!
}
+
public void destroyed() {
theCiv.cities.remove(this);
! removeOldLocation(true);
!
! Enumeration e=theGrids.elements();
while(e.hasMoreElements()) {
((Grid)e.nextElement()).occupier=null;
}
}
+
public void scoutLand(Vector grids,Vector sectorsToScout) {
! grids.addAll(theGrids);
! Enumeration e = buildings.elements();
! while(e.hasMoreElements()) {
! ((Structure)e.nextElement()).scoutLand(grids,null);
! }
}
+
+
public void writeObject(ChaosStream out) throws java.io.IOException {
Index: GalaxyObject.java
===================================================================
RCS file: /cvsroot/chaosrts/net/sourceforge/chaosrts/common/GalaxyObject.java,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -d -r1.21 -r1.22
*** GalaxyObject.java 29 May 2002 05:14:35 -0000 1.21
--- GalaxyObject.java 14 Aug 2002 19:33:30 -0000 1.22
***************
*** 59,125 ****
*/
public GalaxyLocation theLoc;
! /**Find the nearest location to the given City, whether or not on water.
! *
! *@author LiChaimGuy
! *@since 0.0.0pre2
! *@param builtLocation City this is built in.
! *@param onWater Whether or not to build on water (if false, build on any kind of land)
! *@param bwidth Width of the thing to build
! *@param bheight Height of the thing to build
! */
! public static GalaxyLocation getLocationOutsideCity(City builtLocation,boolean onWater,int bwidth,int bheight) {
! //FIXME Fix this up; or should we even have it?
! return null;
! /*
! int desX=builtLocation.X(),desY=builtLocation.Y();
! int left=desX,right=builtLocation.bottomRight.X,top=desY,bottom=builtLocation.bottomRight.Y;
! Grid map[][]=builtLocation.topLeft.thePlanet.map;
! int width=map.length,height=map[0].length;
! //FIXME Hashtable revealed=builtLocation.theCiv.revealedGalaxyObjects;
! Grid dest=null;
! int hor=1,ver=0;
! for(;dest==null;desX+=hor,desY+=ver) {
! if(hor!=0) { //Work on horizontal
! if(desX>=width) //Loop over the map
! desX=0;
! else if(desX<0) //Loop over the map the other way
! desX=width-1;
! if(desX>=right) {
! hor=0;
! ver=1;
! right++;
! if(right>=width)
! right=0;
! }
! else if(desX<=left) {
! hor=0;
! ver=-1;
! left--;
! if(left<0)
! left=width-1;
! }
! }
! else { //Work on vertical
! if(desY>=top) {
! ver=0;
! hor=1;
! if(top<height-1)
! top++;
! }
! else if(desY<=bottom) {
! ver=0;
! hor=-1;
! if(top>0)
! top--;
! }
! }
! //Check if I can build here
! Grid g=map[desX][desY];
! if(g.hasRoomForBuilding(bwidth,bheight,onWater))
! dest=g;
! }
! return dest;
! */
! }
/**Return my location as a GalaxyLocation.
*
--- 59,63 ----
*/
public GalaxyLocation theLoc;
!
/**Return my location as a GalaxyLocation.
*
***************
*** 198,212 ****
}
! /**For scouting: add to grids all the Grid's seen from the given starting points and the given range.*/
! public static void getScoutedGrids(Vector grids,Vector starting,int range) {
! Vector toScout=new Vector();
Hashtable dontScout=new Hashtable(); //Key=Grid,value=GridToScout
! //Setup toScout from starting
! Enumeration e=starting.elements();
! while(e.hasMoreElements())
! toScout.add(new GridToScout((Grid)e.nextElement(),(short)0));
GridToScout g;
! Planet p=((Grid)starting.firstElement()).thePlanet;
while((g=(GridToScout)toScout.firstElement())!=null) {
--- 136,149 ----
}
!
! public static void getScoutedGrids(Vector grids,Grid starting,int range) {
!
! Vector toScout=new Vector();
Hashtable dontScout=new Hashtable(); //Key=Grid,value=GridToScout
!
! toScout.add(new GridToScout(starting,(short)0));
GridToScout g;
! Planet p = starting.thePlanet;
while((g=(GridToScout)toScout.firstElement())!=null) {
***************
*** 235,239 ****
}
}
! }
/**For scouting: add the given Grid's to the given Vector of GalaxyObject's and Hashtable of planets.
*
--- 172,177 ----
}
}
!
! }
/**For scouting: add the given Grid's to the given Vector of GalaxyObject's and Hashtable of planets.
*
***************
*** 245,249 ****
*@return Vector of all Grid's that were added to planets or null
*/
! public Vector addScoutedGrids(Vector objects,Hashtable planets,Vector grids) {
//Check if we have any work
if(grids.size()<=0)
--- 183,188 ----
*@return Vector of all Grid's that were added to planets or null
*/
!
! public Vector addScoutedGrids(Hashtable objects,Hashtable planets,Hashtable citys,Hashtable structures, Hashtable groundStructures,Vector grids) {
//Check if we have any work
if(grids.size()<=0)
***************
*** 263,277 ****
//Check out diplomacy on this object
inspectGalaxyObject(go);
! objects.add(go);
!
! if(go instanceof City) { //Add all the Structure's inside (and outside) this City
! Enumeration structs=((City)go).buildings.elements();
! while(structs.hasMoreElements()) {
! Structure s=(Structure)structs.nextElement();
! if(!objects.contains(s)) //Haven't added this structure yet
! objects.add(s);
! }
! }
}
}
--- 202,240 ----
//Check out diplomacy on this object
inspectGalaxyObject(go);
+
+ if(go instanceof MoveableGalaxyObject) {
+ Vector v = (Vector) objects.get(thePlanet);
+ if(v==null) {
+ v = new Vector();
+ objects.put(thePlanet,v);
+ }
+ if(!v.contains(go)) {
+ v.add(go);
+ }
+ } else if(go instanceof City) {
+ Vector v = (Vector) citys.get(thePlanet);
+ if(v==null) {
+ v = new Vector();
+ objects.put(thePlanet,v);
+ }
+ if(!v.contains(go)) {
+ v.add(go);
+ }
+
+ if(!structures.containsKey(go)) {
+ structures.put(go,((City)go).buildings);
+ }
+ } else if(go instanceof GroundStructure) {
+ Vector v = (Vector) groundStructures.get(thePlanet);
+ if(v==null) {
+ v = new Vector();
+ objects.put(thePlanet,v);
+ }
+ if(!v.contains(go)) {
+ v.add(go);
+ }
+ }
!
}
}
***************
*** 302,321 ****
*@return Vector of all Sectors's that were added to planets or null
*/
! public Vector addScoutedSectors(Vector objects,Hashtable planets,Vector sectors) {
Vector ret=new Vector();
!
Enumeration e=sectors.elements();
while(e.hasMoreElements()) {
Sector theSector=(Sector)e.nextElement();
Vector spaceObjects=(Vector)theCiv.theServer.map.spaceObjects.get(theSector);
Enumeration e2=spaceObjects.elements();
while(e2.hasMoreElements()) {
GalaxyObject go=(GalaxyObject)e2.nextElement();
! if(!objects.contains(go))
! objects.add(go);
inspectGalaxyObject(go);
}
!
}
--- 265,294 ----
*@return Vector of all Sectors's that were added to planets or null
*/
! public Vector addScoutedSectors(Hashtable objects,Hashtable planets,Vector sectors) {
Vector ret=new Vector();
!
! Vector space = (Vector) objects.get(Planet.SPACEPLANET);
!
Enumeration e=sectors.elements();
while(e.hasMoreElements()) {
Sector theSector=(Sector)e.nextElement();
+
Vector spaceObjects=(Vector)theCiv.theServer.map.spaceObjects.get(theSector);
Enumeration e2=spaceObjects.elements();
while(e2.hasMoreElements()) {
GalaxyObject go=(GalaxyObject)e2.nextElement();
! if(go instanceof MoveableGalaxyObject) {
! if(!space.contains(go)) {
! space.add(go);
! }
!
! } else {
! System.out.println("Something other than a unit is in space. Huh!");
! }
inspectGalaxyObject(go);
}
!
!
}
***************
*** 342,345 ****
--- 315,327 ----
}
}
+ Vector v = (Vector) planets.get(Planet.SPACEPLANET);
+ e=sectors.elements();
+ while(e.hasMoreElements()) {
+ Sector g=(Sector)e.nextElement();
+ if(!v.contains(g)) {
+ v.add(g);
+ ret.add(g);
+ }
+ }
return ret;
}
***************
*** 352,356 ****
*/
abstract public void scoutLand(Vector gridsToScout,Vector sectorsToScout);
! /**Checks if I should add this Civilization to my diplomacy list.*/
private void inspectGalaxyObject(GalaxyObject go) {
if(!go.theCiv.equals(theCiv)) {
--- 334,341 ----
*/
abstract public void scoutLand(Vector gridsToScout,Vector sectorsToScout);
!
! /**Checks if I should add this Civilization to my diplomacy list.
! *
! */
private void inspectGalaxyObject(GalaxyObject go) {
if(!go.theCiv.equals(theCiv)) {
***************
*** 371,374 ****
--- 356,360 ----
*/
abstract public void destroyed();
+
public void parentWriteObject(ChaosStream out) throws java.io.IOException {
out.writeObject(theCiv);
***************
*** 382,385 ****
--- 368,380 ----
if(this instanceof ChildSerializable)
((ChildSerializable)this).childReadObject(in);
+ }
+ public boolean equals(Object o) {
+ if(o==this) return true;
+ if(!(o instanceof GalaxyObject))
+ return false;
+ GalaxyObject c=(GalaxyObject)o;
+ return (theCiv==c.theCiv&&
+ theLoc==c.theLoc&&
+ super.equals(o));
}
}
Index: GroundStructure.java
===================================================================
RCS file: /cvsroot/chaosrts/net/sourceforge/chaosrts/common/GroundStructure.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** GroundStructure.java 11 Apr 2002 06:26:07 -0000 1.3
--- GroundStructure.java 14 Aug 2002 19:33:30 -0000 1.4
***************
*** 2,22 ****
This file is part of Chaotic Domain, an advanced and highly
customizable real-time strategy game written in Java.
!
Copyright (C) 2001 Michael Snoyman
!
Chaotic Domain is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
!
Chaotic Domain is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
!
You should have received a copy of the GNU General Public License
along with Chaotic Domain; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
! */
package net.sourceforge.chaosrts.common;
--- 2,22 ----
This file is part of Chaotic Domain, an advanced and highly
customizable real-time strategy game written in Java.
!
Copyright (C) 2001 Michael Snoyman
!
Chaotic Domain is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
!
Chaotic Domain is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
!
You should have received a copy of the GNU General Public License
along with Chaotic Domain; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
! */
package net.sourceforge.chaosrts.common;
***************
*** 26,31 ****
import javax.media.j3d.*;
- //FIXME andybauer Add this as necesary.
/**An instance of a {@link GroundBuilding}.
--- 26,31 ----
import javax.media.j3d.*;
+ import java.util.*;
/**An instance of a {@link GroundBuilding}.
***************
*** 40,65 ****
public GroundStructure() {}
public GroundStructure(Grid theGrid,GroundBuilding theBuilding,Civilization theCiv) {
! super(theBuilding,theCiv);
! theCity=null;
! benefits=theBuilding.benefits;
! health=theBuilding.hitpoints;
! theGrid.groundStructure=this;
! theCiv.bank.minus(theBuilding.price);
}
public GroundBuilding getBuilding() {
! return (GroundBuilding)theBuilding;
}
- public void writeObject(ChaosStream out) throws java.io.IOException {
- }
- public void readObject(ChaosStream in) throws java.io.IOException {
- String s;
- int i;Object tmpArray[];
- }
- public boolean equals(Object o) {
- if(o==this) return true;
- if(!(o instanceof GroundStructure))
- return false;
- GroundStructure c=(GroundStructure)o;
- return (super.equals(o));
- }
}
--- 40,80 ----
public GroundStructure() {}
public GroundStructure(Grid theGrid,GroundBuilding theBuilding,Civilization theCiv) {
! super(theBuilding,theCiv);
! theCity=null;
! benefits=theBuilding.benefits;
! health=theBuilding.hitpoints;
! theGrid.groundStructure=this;
! theCiv.bank.minus(theBuilding.price);
! setLocation(theGrid,true);
! theCiv.allGroundStructures.add(this);
}
public GroundBuilding getBuilding() {
! return (GroundBuilding)theBuilding;
! }
!
! public void destroyed() {
! removeOldLocation(true);
! theCiv.allGroundStructures.remove(this);
! }
!
! public void scoutLand(Vector grids,Vector sectors) {
!
!
! getScoutedGrids(grids,(Grid)theLoc,theBuilding.radar);
!
! }
!
! public void writeObject(ChaosStream out) throws java.io.IOException {
! }
! public void readObject(ChaosStream in) throws java.io.IOException {
! String s;
! int i;Object tmpArray[];
! }
! public boolean equals(Object o) {
! if(o==this) return true;
! if(!(o instanceof GroundStructure))
! return false;
! GroundStructure c=(GroundStructure)o;
! return (super.equals(o));
}
}
Index: MoveableGalaxyObject.java
===================================================================
RCS file: /cvsroot/chaosrts/net/sourceforge/chaosrts/common/MoveableGalaxyObject.java,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -d -r1.25 -r1.26
*** MoveableGalaxyObject.java 21 Jun 2002 05:58:47 -0000 1.25
--- MoveableGalaxyObject.java 14 Aug 2002 19:33:30 -0000 1.26
***************
*** 2,22 ****
This file is part of Chaotic Domain, an advanced and highly
customizable real-time strategy game written in Java.
!
Copyright (C) 2001 Michael Snoyman
!
Chaotic Domain is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
!
Chaotic Domain is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
!
You should have received a copy of the GNU General Public License
along with Chaotic Domain; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
! */
package net.sourceforge.chaosrts.common;
--- 2,22 ----
This file is part of Chaotic Domain, an advanced and highly
customizable real-time strategy game written in Java.
!
Copyright (C) 2001 Michael Snoyman
!
Chaotic Domain is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
!
Chaotic Domain is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
!
You should have received a copy of the GNU General Public License
along with Chaotic Domain; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
! */
package net.sourceforge.chaosrts.common;
***************
*** 26,29 ****
--- 26,30 ----
import net.sourceforge.chaosrts.protocol.*;
import net.sourceforge.chaosrts.server.galaxy.*;
+ import net.sourceforge.chaosrts.protocol.galaxy.*;
import javax.media.j3d.*;
***************
*** 36,50 ****
*/
abstract public class MoveableGalaxyObject extends GalaxyObject implements ChildSerializable,CheckDeepEqual,ReadOnly {
! public MoveableGalaxyObject() {} //Added so that Class.newInstance can be used
public MoveableGalaxyObject(Civilization theciv) {
! theCiv=theciv;
!
}
- /**The Civilization that owns this.
- *
- *@author LiChaimGuy
- *@since 0.0.0pre2
- */
- public Civilization theCiv;
/**Cycles remaining until I move to my next Grid/Sector.
*
--- 37,45 ----
*/
abstract public class MoveableGalaxyObject extends GalaxyObject implements ChildSerializable,CheckDeepEqual,ReadOnly {
! public MoveableGalaxyObject() {} //Added so that Class.newInstance can be used
public MoveableGalaxyObject(Civilization theciv) {
! theCiv=theciv;
!
}
/**Cycles remaining until I move to my next Grid/Sector.
*
***************
*** 72,76 ****
/**Doing nothing
*
! *
*@author andybauer
*@since 0.0.0pre2
--- 67,71 ----
/**Doing nothing
*
! *
*@author andybauer
*@since 0.0.0pre2
***************
*** 79,83 ****
/** Moving to dest
*
! *
*@author andybauer
*@since 0.0.0pre2
--- 74,78 ----
/** Moving to dest
*
! *
*@author andybauer
*@since 0.0.0pre2
***************
*** 85,89 ****
public static final byte STATUS_MOVING = 1;
/**I am fortifying (only Squad).
! *
*@author andybauer
*@since 0.0.0pre2
--- 80,84 ----
public static final byte STATUS_MOVING = 1;
/**I am fortifying (only Squad).
! *
*@author andybauer
*@since 0.0.0pre2
***************
*** 92,96 ****
/**Building a city (only Settler!)
*
! *
*@author andybauer
*@since 0.0.0pre2
--- 87,91 ----
/**Building a city (only Settler!)
*
! *
*@author andybauer
*@since 0.0.0pre2
***************
*** 99,103 ****
/**Building a GroundStructur (only Settler!)
*
! *
*@author andybauer
*@since 0.0.0pre2
--- 94,98 ----
/**Building a GroundStructur (only Settler!)
*
! *
*@author andybauer
*@since 0.0.0pre2
***************
*** 111,115 ****
* <P>By the way, you can only pillage enemy stuff and your own
* stuff, not the stuff of your allies.
! *
*@author LiChaimGuy
*@since 0.0.0pre3
--- 106,110 ----
* <P>By the way, you can only pillage enemy stuff and your own
* stuff, not the stuff of your allies.
! *
*@author LiChaimGuy
*@since 0.0.0pre3
***************
*** 117,123 ****
public static final byte STATUS_PILLAGING = 5;
/**What I'm currently doing.
*
! *
*@author LiChaimGuy
*@since 0.0.0pre2
--- 112,125 ----
public static final byte STATUS_PILLAGING = 5;
+ /** This is the timestamp of the last unit engine run.
+ *
+ *@author andybauer
+ *@since 0.0.0pre3
+ */
+ public static long lastUnitEngineRun = System.currentTimeMillis();
+
/**What I'm currently doing.
*
! *
*@author LiChaimGuy
*@since 0.0.0pre2
***************
*** 144,147 ****
--- 146,157 ----
*@since 0.0.0pre2
*/
+
+ /** All the grids the unit visited, used for scoutLand
+ *
+ *@author andybauer
+ *@since 0.0.0pre3
+ */
+ transient Vector visitedLocations = new Vector();
+
abstract public byte agression();
/**Move to a new location.
***************
*** 151,188 ****
*
*@author LiChaimGuy
! *@since 0.0.0pre2
*/
! public void setNewLocation(GalaxyLocation gl) {
! //Remove old location
! boolean changedPlanet=true;
! if(gl instanceof Grid && theLoc instanceof Grid)
! changedPlanet=(((Grid)gl).thePlanet==((Grid)theLoc).thePlanet);
! removeOldLocation(changedPlanet);
!
! //Now set the new location.
! if(gl instanceof Grid) { //On the ground
! if(changedPlanet)
! ((Grid)gl).thePlanet.groundObjects.add(this);
! }
! else { //In space
! Vector v=(Vector)((Sector)gl).theServer.map.spaceObjects.get(gl);
! if(v==null) {
! v=new Vector();
! ((Sector)gl).theServer.map.spaceObjects.put(gl,v);
! }
! v.add(this);
! }
! GalaxyLocation prevl=getGalaxyLocation();
! theLoc=gl;
! Object o;
! GalaxyLocation l=getGalaxyLocation();
! if((o=theCiv.theServer.battles.get(l))!=null)
! ((BattleEngine)o).add(this,prevl.X()-l.X(),prevl.Y()-l.Y(),prevl.Z()-l.Z());
! else if(theCiv.containsEnemy(l) && BattleEngine.enoughAgression(l))
! new BattleEngine(l);
}
/**How many cycles of movement are completed in one unit engine cycle.
*
- * //FIXME Figure out a good value for here.
*
*@author LiChaimGuy
--- 161,198 ----
*
*@author LiChaimGuy
! *@since 0.0.0pre2
*/
! public void setNewLocation(GalaxyLocation gl) { //FIXME LiChaimGuy this method isn't called anywhere. setLocation is used instead.
! //Place the buttom(battle stuff)part of code somewhere else
! //Remove old location
! boolean changedPlanet=true;
! if(gl instanceof Grid && theLoc instanceof Grid)
! changedPlanet=(((Grid)gl).thePlanet==((Grid)theLoc).thePlanet);
! removeOldLocation(changedPlanet);
!
! //Now set the new location.
! if(gl instanceof Grid) { //On the ground
! if(changedPlanet)
! ((Grid)gl).thePlanet.groundObjects.add(this);
! }
! else { //In space
! Vector v=(Vector)((Sector)gl).theServer.map.spaceObjects.get(gl);
! if(v==null) {
! v=new Vector();
! ((Sector)gl).theServer.map.spaceObjects.put(gl,v);
! }
! v.add(this);
! }
! GalaxyLocation prevl=getGalaxyLocation();
! theLoc=gl;
! Object o;
! GalaxyLocation l=getGalaxyLocation();
! if((o=theCiv.theServer.battles.get(l))!=null)
! ((BattleEngine)o).add(this,prevl.X()-l.X(),prevl.Y()-l.Y(),prevl.Z()-l.Z());
! else if(theCiv.containsEnemy(l) && BattleEngine.enoughAgression(l))
! new BattleEngine(l);
}
/**How many cycles of movement are completed in one unit engine cycle.
*
*
*@author LiChaimGuy
***************
*** 190,193 ****
--- 200,258 ----
*/
private static final int movementCycles=100;
+
+ /** Handels assign moveable packets
+ *
+ *This method only handels stuff for all MGO's.
+ * Stuff like building citys or fortyfying is done in the overriden version
+ *
+ *@author andybauer
+ *@since 0.0.0pre3
+ */
+ public void setAssignMoveablePacket(AssignMoveablePacket packet) {
+
+ //first stop current status
+ if(status == STATUS_MOVING) {
+
+
+ long time = (System.currentTimeMillis()-lastUnitEngineRun)/1000;
+ remCycles += 100-time/theCiv.theServer.unitEngine.delay*100;
+ move();
+
+ if(packet.status!=STATUS_MOVING) {
+ path=null;
+ dest = null;
+ remCycles = 0;
+ }
+
+ }
+
+ if(packet.status==STATUS_NOTHING) {
+ status = STATUS_NOTHING;
+ } else if(packet.status==STATUS_MOVING) {
+
+ GalaxyLocation dest = null;
+ if(packet.destx>=0) {
+ if(packet.planet !=null) {
+
+ dest=packet.planet.map[packet.destx][packet.desty];
+ }
+ else { //A Sector
+
+ dest=theCiv.theServer.map.sectors[packet.destx][packet.desty][packet.destz];
+ }
+ }
+
+ if(setDest(dest)) {
+
+ status = STATUS_MOVING;
+ } else if(dest==null) {
+ status = STATUS_NOTHING;
+ remCycles=0;
+ }
+
+ }
+
+ }
+
/**Basic move routine: move to a destination.
*
***************
*** 197,232 ****
*@since 0.0.0pre2
*/
! public void move() {
! remCycles-=movementCycles;
! if(remCycles<=0) {
! Object o=path.firstElement(); //Next place to go
! path.remove(0);
! setRemCycles();
!
! //Set civ arrival order stuff.
!
! //Leaving old grid
! if(theLoc instanceof Grid) {
! Grid g=(Grid)theLoc;
! if(g.theCivs.firstElement()==theCiv) { //I was the first civ here
! g.prevDefendCiv=theCiv;
! theCiv.theServer.resetGrids.add(g);
! }
! g.theCivs.remove(theCiv);
! }
!
! //Entering new grid
! if(o instanceof Grid) {
! Grid g=(Grid)o;
! if(g.theCivs.indexOf(theCiv)==-1) //My civ isn't in the Vector
! g.theCivs.add(theCiv);
! }
! //Remove myself from my last position
! setLocation((GalaxyLocation)o);
! doArrivalStuff((GalaxyLocation)o);
!
! }
}
!
/**Checks the prevDefendCiv on the Grid I'm at and does the appropriate stuff.
*
--- 262,319 ----
*@since 0.0.0pre2
*/
! public void move() { //FIXME see setDest(Grid), path may contain Planets!!!
! remCycles-=movementCycles;
! System.out.println("remCycles: "+remCycles);
! while(remCycles<=0&&path.size()>0) {
!
! GalaxyLocation o= (GalaxyLocation) path.firstElement(); //we got there
!
! System.out.println("We got to "+o.toString());
! path.remove(0);
! if(path.size()>0) {
! short tmpRemCycle = remCycles;
! setRemCycles();
! remCycles += tmpRemCycle;
! System.out.println("remCycles: "+remCycles);
! if(remCycles<0) {
! visitedLocations.add(o); //ok we are traveling to an other grid this turn
! }
! } else {
! status = STATUS_NOTHING; //we are done
! dest = null;
! remCycles = 0;
! System.out.println("We reached our dest.");
! }
!
!
!
! /*
! //Leaving old grid
! if(theLoc instanceof Grid) {
! Grid g=(Grid)theLoc;
! if(g.theCivs.firstElement()==theCiv) { //I was the first civ here //FIXME LiChaimGuy this causes a NoSuchElemnt exception
! g.prevDefendCiv=theCiv;
! theCiv.theServer.resetGrids.add(g);
! }
! g.theCivs.remove(theCiv);
! }
!
! //Entering new grid
! if(o instanceof Grid) {
! Grid g=(Grid)o;
! if(g.theCivs.indexOf(theCiv)==-1) //My civ isn't in the Vector
! g.theCivs.add(theCiv);
! }*/
!
! //Set civ arrival order stuff.
! setLocation((GalaxyLocation)o);
! doArrivalStuff((GalaxyLocation)o);
!
!
! }
}
!
!
!
/**Checks the prevDefendCiv on the Grid I'm at and does the appropriate stuff.
*
***************
*** 235,249 ****
*/
public void handlePrevDefendCivs() {
! if(theLoc instanceof Grid) {
! Grid g=(Grid)theLoc;
! if(g.prevDefendCiv==theCiv) {
! g.theCivs.remove(theCiv);
! g.theCivs.add(0,theCiv);
! }
! }
}
!
!
!
/**Do stuff that should be done when I reach a new destination.
*
--- 322,336 ----
*/
public void handlePrevDefendCivs() {
! if(theLoc instanceof Grid) {
! Grid g=(Grid)theLoc;
! if(g.prevDefendCiv==theCiv) {
! g.theCivs.remove(theCiv);
! g.theCivs.add(0,theCiv);
! }
! }
}
!
!
!
/**Do stuff that should be done when I reach a new destination.
*
***************
*** 259,312 ****
*/
public synchronized void setRemCycles() {
! Object o=path.firstElement();
! if(o instanceof Grid) {
! Grid g=(Grid)o;
! remCycles=g.adjustSpeed(getSpeed()[g.type.cat]);
! }
! else
! remCycles=getSpeed()[Terrain.CAT_SPACE];
! if(remCycles==0) { //Cannot travel on this type of terrain, get a new path
! boolean b=setDest(dest);
! if(b==false) //Still can't travel there
! setStatus(false);
! }
}
public synchronized boolean setDest(GalaxyLocation dest) {
! Vector tmp=path;
! path=new Vector();
! boolean b;
! if(dest instanceof Grid)
! b=setDest((Grid)dest);
! else
! b=setDest((Sector)dest);
! path.trimToSize();
! if(!b) {
! System.err.println("Couldn't get a path to the given destination");
! path=tmp;
! }
! else {
! setRemCycles();
! setStatus(true);
! this.dest=dest;
! }
! return b;
}
private boolean setDest(Grid dest) {
! if(getSpeed()[Terrain.CAT_SPACE]>0) {
! if(theLoc instanceof Grid &&
! dest.thePlanet.equals(((Grid)theLoc).thePlanet)) {
! path.add(dest.thePlanet);
! path.add(dest);
! }
! else if(theLoc instanceof Grid){
! boolean b=setDest(((Grid)theLoc).thePlanet.theSystem.theSector,dest.thePlanet.theSystem.theSector);
! if(!b)
! return false;
! path.add(dest);
! }
! return true;
! }
! return setDest((Grid)theLoc,dest);
}
/**Setup a new destination.
--- 346,417 ----
*/
public synchronized void setRemCycles() {
! Object o=path.firstElement();
! if(o instanceof Grid) {
! Grid g=(Grid)o;
! remCycles=g.adjustSpeed(getSpeed()[g.type.cat]);
! }
! else
! remCycles=getSpeed()[Terrain.CAT_SPACE];
! if(remCycles==0) { //Cannot travel on this type of terrain, get a new path
! boolean b=setDest(dest);
! if(b==false) //Still can't travel there
! status = STATUS_NOTHING;
! }
}
public synchronized boolean setDest(GalaxyLocation dest) {
! if(dest!=null) {
! Vector tmp=path;
! path=new Vector();
! boolean b;
!
! if(dest instanceof Grid) {
! b=setDest((Grid)dest);
! } else {
! b=setDest((Sector)dest);
! }
!
! path.trimToSize();
!
! if(!b) {
! System.err.println("Couldn't get a path to the given destination");
! path=tmp;
!
! }
! else {
! this.dest = dest;
! if(tmp==null||tmp.size()<1||!(path.firstElement()==tmp.firstElement())){
!
! setRemCycles();
!
! long time = (System.currentTimeMillis()-lastUnitEngineRun)/1000;
! remCycles += time/theCiv.theServer.unitEngine.delay*100;
!
! this.dest=dest;
! }
! }
!
! return b;
! } else {
! this.dest=null;
! }
! return true;
}
private boolean setDest(Grid dest) {
! if(getSpeed()[Terrain.CAT_SPACE]>0) {
! if(theLoc instanceof Grid &&
! dest.thePlanet.equals(((Grid)theLoc).thePlanet)) {
! path.add(dest.thePlanet);
! path.add(dest);
! }
! else if(theLoc instanceof Grid){
! boolean b=setDest(((Grid)theLoc).thePlanet.theSystem.theSector,dest.thePlanet.theSystem.theSector);
! if(!b)
! return false;
! path.add(dest);
! }
! return true;
! }
! return setDest((Grid)theLoc,dest);
}
/**Setup a new destination.
***************
*** 317,366 ****
*/
private boolean setDest(Grid start,Grid dest) {
! synchronized(this) {
! //This assumes space travel is not possible
! if(!dest.thePlanet.equals(start.thePlanet))
! //Not on the same planet, this can't work
! return false;
! Vector v=PathFinder.getPath(start,dest,theCiv.revealedPlanets,start.thePlanet,theCiv.revealedGalaxyObjects,getSpeed(),theCiv,agression());
! if(v==null)
! return false;
! path.addAll(v);
! }
! return true;
}
private boolean setDest(Sector dest) {
! short speed[]=getSpeed();
! if(!Terrain.canSpaceTravel(speed))
! return false;
! if(theLoc instanceof Sector)
! return setDest((Sector)theLoc,dest);
! else {
! Sector s=((Grid)theLoc).thePlanet.theSystem.theSector;
! path.add(s);
! setDest(s,dest);
! }
! return true;
}
private boolean setDest(Sector start,Sector dest) {
! if(getSpeed()[Terrain.CAT_SPACE]==0)
! return false;
! byte x=start.x,y=start.y,z=start.z;
! while(!(x==dest.x && y==dest.y && z==dest.z)) {
! x=(byte)sgn(dest.x-x);
! y=(byte)sgn(dest.y-y);
! z=(byte)sgn(dest.z-z);
! path.add(Sector.getSector(x,y,z,theCiv.theServer));
! }
! return true;
}
! /**Set the status of this thing.
! *
! *@param hasDest true if we're moving, false if not
! *@author LiChaimGuy
! *@since 0.0.0pre2
! */
! abstract public void setStatus(boolean hasDest);
! /**What to do when I receive an AssignMoveablePacket.*/
! abstract public void getAssignMoveablePacket(net.sourceforge.chaosrts.protocol.galaxy.AssignMoveablePacket p);
/**Completely irradicate this from memory.
*
--- 422,464 ----
*/
private boolean setDest(Grid start,Grid dest) {
! synchronized(this) {
! //This assumes space travel is not possible
! if(!dest.thePlanet.equals(start.thePlanet))
! //Not on the same planet, this can't work
! return false;
! Vector v=PathFinder.getPath(start,dest,theCiv.revealedPlanets,start.thePlanet,(Vector)theCiv.revealedGalaxyObjects.get(start.thePlanet),getSpeed(),theCiv,agression());
! if(v==null)
! return false;
! path.addAll(v);
! }
! return true;
}
private boolean setDest(Sector dest) {
! short speed[]=getSpeed();
! if(!Terrain.canSpaceTravel(speed))
! return false;
! if(theLoc instanceof Sector)
! return setDest((Sector)theLoc,dest);
! else {
! Sector s=((Grid)theLoc).thePlanet.theSystem.theSector;
! path.add(s);
! setDest(s,dest);
! }
! return true;
}
private boolean setDest(Sector start,Sector dest) {
! if(getSpeed()[Terrain.CAT_SPACE]==0)
! return false;
! byte x=start.x,y=start.y,z=start.z;
! while(!(x==dest.x && y==dest.y && z==dest.z)) {
! x=(byte)sgn(dest.x-x);
! y=(byte)sgn(dest.y-y);
! z=(byte)sgn(dest.z-z);
! path.add(Sector.getSector(x,y,z,theCiv.theServer));
! }
! return true;
}
!
!
/**Completely irradicate this from memory.
*
***************
*** 369,413 ****
*/
public void destroyMoveableGalaxyObject() {
! removeOldLocation(true); //Well, if I'm getting destroyed I guess I'm leaving my planet, huh?
! theCiv.allSquads.remove(this);
}
- /** The BranchGroup of theis GalaxyObject (Java 3D)
- *
- * @since 0.0.0pre2
- * @author andybauer
- */
- public BranchGroup myBranchGroup;
-
- /** The UnitMover of theis GalaxyObject (3D Engine)
- *
- * @since 0.0.0pre2
- * @author andybauer
- */
- public net.sourceforge.chaosrts.client.galaxy.engine.UnitMover myUnitMover;
-
- /**Return the 3D scene for this
- *
- *@author andybauer
- *@since 0.0.0pre2
- */
- public abstract Node getScene() ;
-
-
public void childWriteObject(ChaosStream out) throws java.io.IOException {
! out.writeObject(theCiv);
! out.putShort(remCycles);
! out.writeObject(path);
! out.writeObject(dest);
! out.putByte(status);
}
public void childReadObject(ChaosStream in) throws java.io.IOException {
! theCiv=(Civilization)in.readObject();
! remCycles=in.getShort();
! path=(Vector)in.readObject();
! dest=(GalaxyLocation)in.readObject();
! status=in.getByte();
}
--- 467,501 ----
*/
public void destroyMoveableGalaxyObject() {
! removeOldLocation(true); //Well, if I'm getting destroyed I guess I'm leaving my planet, huh?
! theCiv.allSquads.remove(this);
}
public void childWriteObject(ChaosStream out) throws java.io.IOException {
!
! out.putShort(remCycles);
! out.writeObject(path);
! out.writeObject(dest);
! out.putByte(status);
}
public void childReadObject(ChaosStream in) throws java.io.IOException {
!
! remCycles=in.getShort();
! path=(Vector)in.readObject();
! dest=(GalaxyLocation)in.readObject();
! status=in.getByte();
! }
!
! public boolean equals(Object o) {
! if(o==this) return true;
! if(!(o instanceof MoveableGalaxyObject))
! return false;
! MoveableGalaxyObject c=(MoveableGalaxyObject)o;
! return (remCycles==c.remCycles&&
! path==c.path&&
! dest==c.dest&&
! status==c.status&&
! super.equals(o));
}
Index: Planet.java
===================================================================
RCS file: /cvsroot/chaosrts/net/sourceforge/chaosrts/common/Planet.java,v
retrieving revision 1.33
retrieving revision 1.34
diff -C2 -d -r1.33 -r1.34
*** Planet.java 21 Jun 2002 05:58:47 -0000 1.33
--- Planet.java 14 Aug 2002 19:33:30 -0000 1.34
***************
*** 35,38 ****
--- 35,40 ----
/**The next {@link #planetID}.*/
private static int nextPlanetID=0;
+
+ public static final Planet SPACEPLANET = new Planet();
public Planet() {} //Added so that Class.newInstance can be used
***************
*** 87,91 ****
*/
public transient Grid map[][];
! /**Vector of all the stuff (City's, Settler's, Structure's and Squad's) on this planet.
*
*@author LiChaimGuy
--- 89,93 ----
*/
public transient Grid map[][];
! /**Vector of all the stuff (City's, Settler's, Structure's, Squad's and GroundStructures) on this planet.
*
*@author LiChaimGuy
Index: ProductionTemplate.java
===================================================================
RCS file: /cvsroot/chaosrts/net/sourceforge/chaosrts/common/ProductionTemplate.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** ProductionTemplate.java 20 Mar 2002 19:40:01 -0000 1.7
--- ProductionTemplate.java 14 Aug 2002 19:33:30 -0000 1.8
***************
*** 29,33 ****
public interface ProductionTemplate {
public Commodity getPrice();
! public GalaxyLocation getPlacedLocation(City builtLocation);
public GalaxyObject makeNew(net.sourceforge.chaosrts.server.galaxy.Civilization theCiv);
public int getWidth();
--- 29,33 ----
public interface ProductionTemplate {
public Commodity getPrice();
!
public GalaxyObject makeNew(net.sourceforge.chaosrts.server.galaxy.Civilization theCiv);
public int getWidth();
Index: Settler.java
===================================================================
RCS file: /cvsroot/chaosrts/net/sourceforge/chaosrts/common/Settler.java,v
retrieving revision 1.37
retrieving revision 1.38
diff -C2 -d -r1.37 -r1.38
*** Settler.java 21 Jun 2002 05:58:47 -0000 1.37
--- Settler.java 14 Aug 2002 19:33:30 -0000 1.38
***************
*** 2,22 ****
This file is part of Chaotic Domain, an advanced and highly
customizable real-time strategy game written in Java.
!
Copyright (C) 2001 Michael Snoyman, Andreas Bauer
!
Chaotic Domain is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
!
Chaotic Domain is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
!
You should have received a copy of the GNU General Public License
along with Chaotic Domain; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
! */
package net.sourceforge.chaosrts.common;
--- 2,22 ----
This file is part of Chaotic Domain, an advanced and highly
customizable real-time strategy game written in Java.
!
Copyright (C) 2001 Michael Snoyman, Andreas Bauer
!
Chaotic Domain is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
!
Chaotic Domain is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
!
You should have received a copy of the GNU General Public License
along with Chaotic Domain; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
! */
package net.sourceforge.chaosrts.common;
***************
*** 52,56 ****
*/
private static final int productionGenerated=10; //FIXME We may want to change this.
!
/**Only use this constructor if you're using the instance as a ProductionTemplate!!!
*
--- 52,56 ----
*/
private static final int productionGenerated=10; //FIXME We may want to change this.
!
/**Only use this constructor if you're using the instance as a ProductionTemplate!!!
*
***************
*** 59,76 ****
*/
public Settler() {
! super(null);
}
public Settler(Civilization theCiv) {
! super(theCiv);
}
! /**Where I'm going (if status==0).
! *
! * If status==0 and this is null, then I'm doing nothing.
! *
! *@author LiChaimGuy
! *@since 0.0.0pre2
! *@see #status
! */
! public Grid dest;
/**Name of the city I'll make.
*
--- 59,68 ----
*/
public Settler() {
! super(null);
}
public Settler(Civilization theCiv) {
! super(theCiv);
}
!
/**Name of the city I'll make.
*
***************
*** 79,88 ****
*/
public String cityName="Unnamed city";
- /**The Grid's that should be included in the new City.
- *
- *@author LiChaimGuy
- *@since 0.0.0pre3
- */
- public Vector cityGrids;
/**How many cycles remaining on my current settling work.
*
--- 71,74 ----
***************
*** 99,152 ****
public GroundBuilding groundBuilding=null;
public int getSize() {
! return 1;
}
! public void getAssignMoveablePacket(AssignMoveablePacket p) {
! cityName=p.cityName;
! groundBuilding=p.theBuilding;
! cityGrids=p.cityGrids;
}
public void move() {
! if(dest!=null && status==STATUS_MOVING) {
! super.move();
! if(theLoc.equals(dest)) //Reached destination
! dest=null;
! }
! else if(status==STATUS_BUILDING) {
! if(!canBuildGB(groundBuilding,null))
! status=STATUS_NOTHING;
! else {
! if(settlingCycles>0) {
! settlingCycles--;
! if(settlingCycles==0) {
! new GroundStructure((Grid)theLoc,groundBuilding,theCiv);
! status=STATUS_NOTHING;
! }
! }
! else
! settlingCycles=-1;
! }
! }
! else if(status==STATUS_CITY) { //Build a city
! //First check if all the grids for the city are available...
! Enumeration e=cityGrids.elements();
! boolean gridsFree=true;
! while(e.hasMoreElements() && gridsFree) {
! if(((Grid)e.nextElement()).occupier!=null)
! gridsFree=false;
! }
!
! if(!gridsFree) //Grid's aren't all free
! status=STATUS_NOTHING;
! else {
!
! City c=new City(theCiv,cityGrids);
! destroyMoveableGalaxyObject();
! theCiv.cities.add(c);
! theCiv.sendPacket(new CityBuiltPacket(c));
//FIXME LiChaimGuy isn't this the right way?
theCiv.productionComplete(c,ChaosTree.theChaosTree.defaultBuilding,null);
! }
! }
}
/**Whether or not the given GroundBuilding can be built in the given Grid.
--- 85,151 ----
public GroundBuilding groundBuilding=null;
public int getSize() {
! return 1;
}
!
! /** Handels assign moveable packets
! *
! *@author andybauer
! *@since 0.0.0pre3
! */
! public void setAssignMoveablePacket(AssignMoveablePacket packet) {
! if(status==STATUS_BUILDING) {
! settlingCycles=0;
! groundBuilding = null;
! } else if(status==STATUS_CITY) {
! cityName="Unnamed city";
! }
! super.setAssignMoveablePacket(packet);
!
! if(packet.status==STATUS_BUILDING) {
! setBuilding(packet.theBuilding);
! status = STATUS_BUILDING;
! } else if(status==STATUS_CITY) {
! cityName=packet.cityName;
! status=STATUS_CITY;
! }
!
}
+
public void move() {
! if(dest!=null && status==STATUS_MOVING) {
! super.move();
! }
!
! else if(status==STATUS_BUILDING) {
! if(!canBuildGB(groundBuilding,null)) //FIXME do we need to check this every turn?
! status=STATUS_NOTHING;
! else {
! if(settlingCycles>0) {
! settlingCycles--;
! if(settlingCycles==0) {
! new GroundStructure((Grid)theLoc,groundBuilding,theCiv);
! status=STATUS_NOTHING;
! }
! }
! else
! settlingCycles=-1;
! }
! }
! else if(status==STATUS_CITY) { //Build a city
!
! //First check if the grid for the city is available...
! if(((Grid)theLoc).occupier!=null) {
! status=STATUS_NOTHING;
! } else {
!
! City c=new City(theCiv,(Grid)theLoc);
! destroyMoveableGalaxyObject();
!
! theCiv.sendPacket(new CityBuiltPacket(c));
//FIXME LiChaimGuy isn't this the right way?
theCiv.productionComplete(c,ChaosTree.theChaosTree.defaultBuilding,null);
! }
! }
}
/**Whether or not the given GroundBuilding can be built in the given Grid.
***************
*** 154,167 ****
*@author LiChaimGuy
*@since 0.0.0pre2
! *@param grid Grid to check in; if null, check dest; if dest==null, check topLeft.
*/
public boolean canBuildGB(GroundBuilding gb,Grid grid) {
! try {
! if(grid.groundStructure==null && theCiv.bank.hasResources(gb.price))
! return true;
! }
! catch(InsufficientResourcesException e) {
! }
! return false;
}
/**Sets the new {@link #groundBuilding}.
--- 153,166 ----
*@author LiChaimGuy
*@since 0.0.0pre2
! *@param grid Grid to check in; if null, check dest; if dest==null, check topLeft.//FIXME implement this
*/
public boolean canBuildGB(GroundBuilding gb,Grid grid) {
! try {
! if(grid.groundStructure==null && theCiv.bank.hasResources(gb.price)) //FIXME check if techs are researched
! return true;
! }
! catch(InsufficientResourcesException e) {
! }
! return false;
}
/**Sets the new {@link #groundBuilding}.
***************
*** 171,224 ****
*/
public void setBuilding(GroundBuilding gb) {
! settlingCycles=gb.price.production/productionGenerated;
! groundBuilding=gb;
! status=STATUS_BUILDING;
}
public Commodity getPrice() {
! return ChaosTree.theChaosTree.settlerCost;
! }
! public GalaxyLocation getPlacedLocation(City builtLocation) {
! if(builtLocation==null)
! return null;
! return(builtLocation.theLoc);
}
public GalaxyObject makeNew(Civilization theCiv) {
! return (new Settler(theCiv));
! }
! public void setStatus(boolean b) {
! status=(byte)(b?STATUS_MOVING:STATUS_NOTHING);
}
public void scoutLand(Vector grids,Vector sectors) {
! //Scout out my grid and all grids surrounding it
! int x=Math.max(0,theLoc.X()-1);
! int y=Math.max(0,theLoc.Y()-1);
!
! Planet p=((Grid)theLoc).thePlanet;
!
! for(int i=0;x<p.width && i<3;i++,x++) {
! for(int j=0;y<p.height && j<3;j++,y++) {
! grids.add(p.map[x][y]);
! }
! y=Math.max(0,theLoc.Y()-1); //Reset y
! }
}
public short[] getSpeed() {
! short ret[]={1,1,1,1,0,0};
! return ret;
}
public int getWidth() {
! return 1;
}
public int getHeight() {
! return 1;
}
public boolean isOnWater() {
! return false;
}
public byte agression() {
! return (byte)-10;
}
public Vector prereqs() {
! return new Vector(); //Has no prereqs
}
--- 170,226 ----
*/
public void setBuilding(GroundBuilding gb) {
! if(gb!=null &&canBuildGB(gb,null)) {
! settlingCycles=gb.price.production/productionGenerated;
! groundBuilding=gb;
! }
!
}
public Commodity getPrice() {
! return ChaosTree.theChaosTree.settlerCost;
}
+
public GalaxyObject makeNew(Civilization theCiv) {
! return (new Settler(theCiv));
}
+
public void scoutLand(Vector grids,Vector sectors) {
! //Scout out my grid and all grids surrounding it
!
!
! Planet p=((Grid)theLoc).thePlanet;
!
! visitedLocations.add(theLoc);
! Enumeration e = visitedLocations.elements();
!
! while(e.hasMoreElements()) {
! Grid toAdd = (Grid) e.nextElement();
!
! for(int i=-1;(toAdd.X()+i)<p.width &&(toAdd.X()+i)>-1&& i<2;i++) {
! for(int j=-1;(toAdd.Y()+j)<p.height &&(toAdd.Y()+j)>-1&& j<2;j++) {
! grids.add(p.map[toAdd.X()+i][toAdd.Y()+j]);
! }
!
! }
! }
! visitedLocations.clear();
}
public short[] getSpeed() {
! short[] ret = {200,200,200,200,0,0}; //FIXME add to the Chaos Tree Editor
! return ret;
}
public int getWidth() {
! return 1;
}
public int getHeight() {
! return 1;
}
public boolean isOnWater() {
! return false;
}
public byte agression() {
! return (byte)-10;
}
public Vector prereqs() {
! return new Vector(); //Has no prereqs
}
***************
*** 227,290 ****
return "Settler";
}
!
public void destroyed() {
! System.out.println("FIXME!!! Settler.destroyed not implemented yet!!!");
}
! /**the 3D model for a settler
! *
! *@author andybauer
! *@since 0.0.0pre2
! */
! private transient javax.media.j3d.Node scene;
!
! /** returns the Java 3D model for a settler
! *
! *@author andybauer
! *@since 0.0.0pre2
! */
! public javax.media.j3d.Node getScene() {
! if(scene!=null) {
! return scene.cloneTree(false);
! } else {
! try{
!
! Scene tmp = Engine3D.load3DFile("/data/"+ChaosTree.theChaosTree.mod+"/shells/"+ChaosTree.theChaosTree.settlerModel);
! scene = tmp.getSceneGroup();
! return scene;
! } catch(Exception e) {
! Debug.debugMsg("Can't load the settler model");
! e.printStackTrace();
! }
! }
! return null;
}
- public void writeObject(ChaosStream out) throws java.io.IOException {
- out.putInt(settlingCycles);
- out.writeObject(cityName);
- out.writeObject(dest);
-...
[truncated message content] |
|
From: Andreas B. <and...@us...> - 2002-08-14 19:33:34
|
Update of /cvsroot/chaosrts/net/sourceforge/chaosrts/protocol/galaxy
In directory usw-pr-cvs1:/tmp/cvs-serv13101/sourceforge/chaosrts/protocol/galaxy
Modified Files:
AssignMoveablePacket.java DiscoveredStuffPacket.java
JAVA.SOURCES
Added Files:
CityUpdatePacket.java GroundStructuresUpdatePacket.java
MGOUpdatePacket.java
Log Message:
fixed a lot of bug, improved unit movement/ scouting stuff, splited DiscoverdStuff and much more
--- NEW FILE: CityUpdatePacket.java ---
/*
This file is part of Chaotic Domain, an advanced and highly
customizable real-time strategy game written in Java.
Copyright (C) 2002 Michael Snoyman, Andreas Bauer
Chaotic Domain is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
Chaotic Domain is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Chaotic Domain; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
package net.sourceforge.chaosrts.protocol.galaxy;
import net.sourceforge.chaosrts.protocol.*;
import net.sourceforge.chaosrts.common.*;
import net.sourceforge.chaosrts.server.galaxy.*;
import java.util.*;
/**Informs the client of all knowen citys and Structures in them of the planet the client is watching
*
*@author andybauer
*@since 0.0.0pre3
*/
public class CityUpdatePacket extends CivUpdatePacket {
public Vector cities;
public Hashtable structures;
public CityUpdatePacket() {} //Added so that Class.newInstance can be used
public CityUpdatePacket(Vector cities, Hashtable structures) {
this.cities = cities;
this.structures = structures;
}
public ControlRights reqRights() {
return new ControlRights(); //You could need this no matter what your job
}
public void readObject(ChaosStream cs) throws java.io.IOException {
cities = (Vector)cs.readObject();
structures = (Hashtable) cs.readObject();
}
public void writeObject(ChaosStream cs) throws java.io.IOException {
cs.writeObject(cities);
cs.writeObject(structures);
}
}
--- NEW FILE: GroundStructuresUpdatePacket.java ---
/*
This file is part of Chaotic Domain, an advanced and highly
customizable real-time strategy game written in Java.
Copyright (C) 2002 Michael Snoyman, Andreas Bauer
Chaotic Domain is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
Chaotic Domain is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Chaotic Domain; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
package net.sourceforge.chaosrts.protocol.galaxy;
import net.sourceforge.chaosrts.protocol.*;
import net.sourceforge.chaosrts.common.*;
import net.sourceforge.chaosrts.server.galaxy.*;
import java.util.*;
/**Informs the client of all knowen GroundStructures
*
*@author andybauer
*@since 0.0.0pre3
*/
public class GroundStructuresUpdatePacket extends CivUpdatePacket {
public Vector structures;
public GroundStructuresUpdatePacket() {} //Added so that Class.newInstance can be used
public GroundStructuresUpdatePacket(Vector structures) {
this.structures = structures;
}
public ControlRights reqRights() {
return new ControlRights(); //You could need this no matter what your job
}
public void readObject(ChaosStream cs) throws java.io.IOException {
structures = (Vector) cs.readObject();
}
public void writeObject(ChaosStream cs) throws java.io.IOException {
cs.writeObject(structures);
}
}
--- NEW FILE: MGOUpdatePacket.java ---
/*
This file is part of Chaotic Domain, an advanced and highly
customizable real-time strategy game written in Java.
Copyright (C) 2002 Michael Snoyman, Andreas Bauer
Chaotic Domain is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
Chaotic Domain is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Chaotic Domain; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
package net.sourceforge.chaosrts.protocol.galaxy;
import net.sourceforge.chaosrts.protocol.*;
import net.sourceforge.chaosrts.common.*;
import net.sourceforge.chaosrts.server.galaxy.*;
import java.util.*;
/**Informs the client of the state of Moveable Galaxy Objects on the current viewen Planet (or Space)
*
*
*@author andybauer
*@since 0.0.0pre3
*/
public class MGOUpdatePacket extends CivUpdatePacket {
public Vector mgo;
public MGOUpdatePacket() {} //Added so that Class.newInstance can be used
public MGOUpdatePacket(Vector objects, Civilization civ) {
mgo = objects;
if(mgo == null) {
mgo=new Vector();
return;
}
Enumeration e=mgo.elements();
while(e.hasMoreElements()) {
MoveableGalaxyObject tmp=(MoveableGalaxyObject)e.nextElement();
if(tmp.theCiv!=civ&&tmp.path!=null) { //Someone else's civ, trim path
while(tmp.path.size()>3) {
tmp.path.remove(3); //FIXME shouldn't all elements from 3 to n removed?
}
}
}
}
public ControlRights reqRights() {
return new ControlRights(); //You could need this no matter what your job
}
public void readObject(ChaosStream cs) throws java.io.IOException {
mgo = (Vector) cs.readObject();
}
public void writeObject(ChaosStream cs) throws java.io.IOException {
cs.writeObject(mgo);
}
}
Index: AssignMoveablePacket.java
===================================================================
RCS file: /cvsroot/chaosrts/net/sourceforge/chaosrts/protocol/galaxy/AssignMoveablePacket.java,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** AssignMoveablePacket.java 21 Jun 2002 05:58:47 -0000 1.18
--- AssignMoveablePacket.java 14 Aug 2002 19:33:30 -0000 1.19
***************
*** 51,55 ****
*@since 0.0.0pre3
*/
! public int destx;
/** The y coordinate of the destinition
*
--- 51,55 ----
*@since 0.0.0pre3
*/
! public int destx = -1;
/** The y coordinate of the destinition
*
***************
*** 67,75 ****
public int destz;
- /** This GalaxyLocation is only used in Civilization and will not sent through the network
- *
- */
- //FIXME LiChaimGuy get ride of this
- public transient GalaxyLocation dest;
/** The planet for the GalaxyLocation d
--- 67,70 ----
***************
*** 98,103 ****
public GroundBuilding theBuilding;
- /**If building a city, the Grid's in it.*/
- public Vector cityGrids;
/**What he should do there.
--- 93,96 ----
***************
*** 108,112 ****
public byte status;
/**Wrapper to the real constructor.*/
! public AssignMoveablePacket(Route r,MoveableGalaxyObject theObj,GalaxyLocation theLoc,byte stat,String cityName,GroundBuilding theBuilding,Vector cityGrids) {
this(r,
theObj,
--- 101,105 ----
public byte status;
/**Wrapper to the real constructor.*/
! /* public AssignMoveablePacket(Route r,MoveableGalaxyObject theObj,GalaxyLocation theLoc,byte stat,String cityName,GroundBuilding theBuilding) {
this(r,
theObj,
***************
*** 117,124 ****
stat,
cityName,
! theBuilding,
! cityGrids);
}
! public AssignMoveablePacket(Route r,MoveableGalaxyObject theobj,int x, int y, int z,Planet planet,byte stat,String cityname,GroundBuilding thebuilding,Vector citygrids) {
super(r);
theObj=theobj;
--- 110,117 ----
stat,
cityName,
! theBuilding
! );
}
! public AssignMoveablePacket(Route r,MoveableGalaxyObject theobj,int x, int y, int z,Planet planet,byte stat,String cityname,GroundBuilding thebuilding) {
super(r);
theObj=theobj;
***************
*** 126,130 ****
cityName=cityname;
theBuilding=thebuilding;
! cityGrids=citygrids;
this.planet=planet;
destx = x;
--- 119,150 ----
cityName=cityname;
theBuilding=thebuilding;
! this.planet=planet;
! destx = x;
! desty = y;
! destz = z;
! }
! */
! /** This constructor is used, if status = NOTHING or FORTIFYING or PILLAGING
! *
! *@author andybauer
! *@since 0.0.0pre3
! */
! public AssignMoveablePacket(Route r,MoveableGalaxyObject theobj,byte status) {
! super(r);
! theObj=theobj;
! this.status = status;
!
! }
!
! /** This constructor is used, if status = MOVING
! *
! *@author andybauer
! *@since 0.0.0pre3
! */
! public AssignMoveablePacket(Route r,MoveableGalaxyObject theobj,byte status,int x, int y, int z,Planet planet) {
! super(r);
! theObj=theobj;
! this.status = status;
!
this.planet=planet;
destx = x;
***************
*** 132,135 ****
--- 152,183 ----
destz = z;
}
+
+ /** This constructor is used, if status = CITY
+ *
+ *@author andybauer
+ *@since 0.0.0pre3
+ */
+ public AssignMoveablePacket(Route r,MoveableGalaxyObject theobj,byte status,String name) {
+ super(r);
+ theObj=theobj;
+ this.status = status;
+ cityName = name;
+
+ }
+
+ /** This constructor is used, if status = Building
+ *
+ *@author andybauer
+ *@since 0.0.0pre3
+ */
+ public AssignMoveablePacket(Route r,MoveableGalaxyObject theobj,byte status,GroundBuilding theBuilding) {
+ super(r);
+ theObj=theobj;
+ this.status = status;
+ this.theBuilding = theBuilding;
+ }
+
+
+
public ControlRights reqRights() {
return new ControlRights(false,true,false,false);
***************
*** 143,147 ****
out.writeObject(cityName);
out.writeObject(theBuilding);
- out.writeObject(cityGrids);
out.writeObject(planet);
out.putInt(destx);
--- 191,194 ----
***************
*** 156,160 ****
cityName=(String)in.readObject();
theBuilding=(GroundBuilding)in.readObject();
- cityGrids=(Vector)in.readObject();
planet=(Planet)in.readObject();
destx=in.getInt();
--- 203,206 ----
***************
*** 171,175 ****
cityName==c.cityName&&
theBuilding==c.theBuilding&&
- cityGrids==c.cityGrids&&
planet==c.planet&&
destx==c.destx&&
--- 217,220 ----
Index: DiscoveredStuffPacket.java
===================================================================
RCS file: /cvsroot/chaosrts/net/sourceforge/chaosrts/protocol/galaxy/DiscoveredStuffPacket.java,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** DiscoveredStuffPacket.java 29 May 2002 05:14:35 -0000 1.18
--- DiscoveredStuffPacket.java 14 Aug 2002 19:33:30 -0000 1.19
***************
*** 27,35 ****
import java.util.*;
! /**Informs the client of all stuff that was discovered by the units (as well as unit positions).
*
! * This only informs of new terrain. It states all unit locations
! * known, regardless of if they've changed (if performance suffers we
! * may have to change this).
*
*@author LiChaimGuy
--- 27,33 ----
import java.util.*;
! /**Informs the client of all discoverd Grids/Sectors
*
! * This only informs of new terrain.
*
*@author LiChaimGuy
***************
*** 42,76 ****
*@author LiChaimGuy
*@since 0.0.0pre2
- *@param s Signature
- *@param destCiv The civ this is being sent to, so that we can trim the paths of enemy units.
- *@param galaxyobjects {@see #galaxyObjects}
*@param newgrids {@see #newGrids}
*/
! public DiscoveredStuffPacket(Civilization destCiv,Vector galaxyobjects,Vector newgrids) {
! galaxyObjects=galaxyobjects;
newGrids=newgrids;
- Enumeration e=galaxyObjects.elements();
-
- while(e.hasMoreElements()) {
- Object o=e.nextElement();
- if(o instanceof MoveableGalaxyObject) { //Check if it's our civ or someone else's
- MoveableGalaxyObject mgo=(MoveableGalaxyObject)o;
- if(mgo.theCiv!=destCiv) { //Someone else's civ, trim path
- while(mgo.path.size()>3)
- mgo.path.remove(3);
- }
- }
- }
}
! /**Vector of GalaxyObject's that have been discovered in the viewed area.
! *
! * <p>Old way: Hashtable with Key=Grid or Sector,Value=Vector of GalaxyObject's there
! *
! *@author LiChaimGuy
! *@since 0.0.0pre2
! */
! public Vector galaxyObjects;
/**Vector of all Grid's that have just been discovered.
*
--- 40,54 ----
*@author LiChaimGuy
*@since 0.0.0pre2
*@param newgrids {@see #newGrids}
*/
! public DiscoveredStuffPacket(Vector newgrids) {
! if(newgrids==null) {
! newgrids = new Vector();
! }
newGrids=newgrids;
}
!
/**Vector of all Grid's that have just been discovered.
*
***************
*** 78,82 ****
*@since 0.0.0pre2
*/
! public Vector newGrids; //FIXME andybauer This is now, by your request, ALL grids on the viewed planet; if in space, this will be null
public ControlRights reqRights() {
return new ControlRights(); //You could need this no matter what your job
--- 56,60 ----
*@since 0.0.0pre2
*/
! public Vector newGrids;
public ControlRights reqRights() {
return new ControlRights(); //You could need this no matter what your job
***************
*** 84,88 ****
public void writeObject(ChaosStream out) throws java.io.IOException {
out.writeObject(newGrids);
! out.writeObject(galaxyObjects);
}
public void readObject(ChaosStream in) throws java.io.IOException {
--- 62,66 ----
public void writeObject(ChaosStream out) throws java.io.IOException {
out.writeObject(newGrids);
!
}
public void readObject(ChaosStream in) throws java.io.IOException {
***************
*** 90,94 ****
int i;Object tmpArray[];
newGrids=(Vector)in.readObject();
! galaxyObjects=(Vector)in.readObject();
}
public boolean equals(Object o) {
--- 68,72 ----
int i;Object tmpArray[];
newGrids=(Vector)in.readObject();
!
}
public boolean equals(Object o) {
***************
*** 98,102 ****
DiscoveredStuffPacket c=(DiscoveredStuffPacket)o;
return (newGrids==c.newGrids&&
- galaxyObjects==c.galaxyObjects&&
super.equals(o));
}
--- 76,79 ----
Index: JAVA.SOURCES
===================================================================
RCS file: /cvsroot/chaosrts/net/sourceforge/chaosrts/protocol/galaxy/JAVA.SOURCES,v
retrieving revision 1.35
retrieving revision 1.36
diff -C2 -d -r1.35 -r1.36
*** JAVA.SOURCES 21 Jun 2002 05:58:47 -0000 1.35
--- JAVA.SOURCES 14 Aug 2002 19:33:30 -0000 1.36
***************
*** 54,55 ****
--- 54,58 ----
FederationVotePacket.java
JoinFederationRequestAlert.java
+ MGOUpdatePacket.java
+ CityUpdatePacket.java
+ GroundStructuresUpdatePacket.java
|
|
From: Andreas B. <and...@us...> - 2002-08-14 19:33:33
|
Update of /cvsroot/chaosrts/net/sourceforge/chaosrts/client/galaxy/engine
In directory usw-pr-cvs1:/tmp/cvs-serv13101/sourceforge/chaosrts/client/galaxy/engine
Modified Files:
Engine3D.java EngineTest.java StructureModel.java
Added Files:
SettlerModel.java SquadModel.java UnitModel.java
Removed Files:
UnitMover.java
Log Message:
fixed a lot of bug, improved unit movement/ scouting stuff, splited DiscoverdStuff and much more
--- NEW FILE: SettlerModel.java ---
/*
This file is part of Chaotic Domain, an advanced and highly
customizable real-time strategy game written in Java.
Copyright (C) 2002 Andreas Bauer
Chaotic Domain is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
Chaotic Domain is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Chaotic Domain; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
package net.sourceforge.chaosrts.client.galaxy.engine;
import net.sourceforge.chaosrts.common.*;
import net.sourceforge.chaosrts.server.galaxy.*;
import java.util.*;
import javax.media.j3d.*;
import javax.vecmath.*;
import com.sun.j3d.loaders.*;
/**
*
* @author andybauer
*/
public class SettlerModel extends UnitModel {
/** Creates a new instance of SettlerModel */
public SettlerModel(Settler unit,Engine3D theEngine) {
theObj = unit;
oldStatus = unit.status;
this.theEngine = theEngine;
container = new BranchGroup();
Scene tmp = null;
try {
tmp = Engine3D.load3DFile("/data/"+ChaosTree.theChaosTree.mod+"/shells/"+ChaosTree.theChaosTree.settlerModel);
} catch(Exception e) {
System.out.println("Couldn't load a Settler model");
return;
}
theModel = tmp.getSceneGroup();
transTG = new TransformGroup();
transTG.setCapability(TransformGroup.ALLOW_TRANSFORM_READ);
transTG.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
trans = new Transform3D();
Grid grid = (Grid) theObj.theLoc;
trans.setTranslation(new Vector3f(grid.X*2+1,theEngine.getHeightAt(grid.X,grid.Y),grid.Y*2+1));
transTG.setTransform(trans);
transTG.addChild(theModel);
//animation = (AnimationBehavior) tmp.getNamedObjects().get("AnimationBehavior");
container.setCapability(BranchGroup.ALLOW_DETACH);
container.setCapability(BranchGroup.ALLOW_CHILDREN_EXTEND);
container.setCapability(BranchGroup.ALLOW_CHILDREN_WRITE);
container.addChild(transTG);
container.setUserData(theObj);
container.setPickable(true);
container.setCapability(Node.ENABLE_PICK_REPORTING);
container.compile();
}
}
--- NEW FILE: SquadModel.java ---
/*
This file is part of Chaotic Domain, an advanced and highly
customizable real-time strategy game written in Java.
Copyright (C) 2002 Andreas Bauer
Chaotic Domain is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
Chaotic Domain is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Chaotic Domain; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
package net.sourceforge.chaosrts.client.galaxy.engine;
/**
*
* @author andybauer
*/
public class SquadModel extends UnitModel {
/** Creates a new instance of SquadModel */
public SquadModel() {
}
}
--- NEW FILE: UnitModel.java ---
/*
* UnitModel.java
*
* Created on August 14, 2002, 12:16 PM
*/
package net.sourceforge.chaosrts.client.galaxy.engine;
import net.sourceforge.chaosrts.common.*;
import net.sourceforge.chaosrts.server.galaxy.*;
import java.util.*;
import javax.media.j3d.*;
import javax.vecmath.*;
/** This is the abstract Base class for Squad/Settler Model
*
* @author andybauer
*/
public abstract class UnitModel {
MoveableGalaxyObject theObj;
TransformGroup transTG;
Transform3D trans;
PositionPathInterpolator interpolator;
Vector path;
byte oldStatus;
/** The 3D Model of the Structure
*
*@author andybauer
*@since 0.0.0pre3
*/
BranchGroup theModel;
/** This group is the BG that is added to the units BG of the 3D Engine
*
*@author andybauer
*@since 0.0.0pre3
*/
BranchGroup container;
Engine3D theEngine;
public void update() {
if(theObj.status == MoveableGalaxyObject.STATUS_MOVING) {
if(!theObj.path.equals(path)) {
Grid next = (Grid)theObj.path.firstElement();
int nextGridTime = next.adjustSpeed(theObj.getSpeed()[next.type.cat]);
nextGridTime = Math.min(nextGridTime,theObj.remCycles);
int totalTime = nextGridTime;
Enumeration e = theObj.path.elements();
e.nextElement(); //ignore the first element
while(e.hasMoreElements()) {
Grid tmp = (Grid) e.nextElement();
totalTime+=tmp.adjustSpeed(theObj.getSpeed()[tmp.type.cat]);
}
Point3f[] positions = new Point3f[theObj.path.size()+1];
float[] knots = new float[theObj.path.size()+1];
positions[0]=getPosition((Grid)theObj.theLoc);
knots[0]=0.0f;
float tmpTime;
e = theObj.path.elements();
e.nextElement(); //ignore the first element
positions[1] = getPosition(next);
knots[1] = tmpTime = nextGridTime/totalTime;
int i = 2;
while(e.hasMoreElements()) {
Grid tmp = (Grid) e.nextElement();
positions[i] = getPosition(tmp);
tmpTime+= tmp.adjustSpeed(theObj.getSpeed()[tmp.type.cat])/totalTime;
knots[i] = tmpTime;
i++;
}
Alpha newAlpha = new Alpha(1,totalTime/100*theEngine.myClient.gameInfo.unitDelay);
if(interpolator==null) {
interpolator = new PositionPathInterpolator(newAlpha,transTG,trans,knots,positions);
interpolator.setSchedulingBounds(new BoundingSphere(new Point3d(0,0,0),3));
BranchGroup tmpGroup = new BranchGroup();
tmpGroup.addChild(interpolator);
container.addChild(tmpGroup);
} else {
interpolator.setPathArrays(knots,positions);
interpolator.setAlpha(newAlpha);
}
}
}
}
public Point3f getPosition(Grid grid) {
return new Point3f(grid.X*2+1,theEngine.getHeightAt(grid.X,grid.Y),grid.Y*2+1);
}
}
Index: Engine3D.java
===================================================================
RCS file: /cvsroot/chaosrts/net/sourceforge/chaosrts/client/galaxy/engine/Engine3D.java,v
retrieving revision 1.37
retrieving revision 1.38
diff -C2 -d -r1.37 -r1.38
*** Engine3D.java 24 Jul 2002 10:00:29 -0000 1.37
--- Engine3D.java 14 Aug 2002 19:33:29 -0000 1.38
***************
*** 142,152 ****
public javax.media.j3d.Locale theLocal;
- /** This thread calls the UnitMovers to update the path,...
- *
- *@author andybauer
- *@since 0.0.0pre2
- */
- public UnitMoverThread unitMoverThread;
-
/** This BoundingLeaf is ever on
*
--- 142,145 ----
***************
*** 290,293 ****
--- 283,295 ----
public Hashtable buildings;
+ /**This Hashtable stores all Buildings
+ *
+ *key: Unit value: UnitModel
+ *
+ *@author andybauer
+ *@since 0.0.0pre2
+ */
+ public Hashtable units;
+
/** This is the used TerrainTextureManager
*
***************
*** 351,354 ****
--- 353,357 ----
buildings = new Hashtable();
+ units = new Hashtable();
//add the behavior
***************
*** 418,427 ****
//buildGraph();
- unitMoverThread = new UnitMoverThread();
-
- unitMoverThread.setSchedulingBoundingLeaf(everOn);
- viewBG.addChild(unitMoverThread);
-
-
BoundingSphere sphere = new BoundingSphere(new Point3d(0,0,-30),40);
viewBounding = new BoundingLeaf(sphere);
--- 421,424 ----
***************
*** 516,519 ****
--- 513,517 ----
//FIXME andybauer reset 3D stuff in GalaxyObject too
buildings.clear();
+ units.clear();
//construct terrain pick part
***************
*** 883,887 ****
Transform3D trans = new Transform3D();
! trans.setTranslation(new Vector3f(position.X,getHeightAt(position.X,position.Y),position.Y));
TransformGroup transTG = new TransformGroup(trans);
--- 881,885 ----
Transform3D trans = new Transform3D();
! trans.setTranslation(new Vector3f(position.X*2,getHeightAt(position.X,position.Y),position.Y*2));
TransformGroup transTG = new TransformGroup(trans);
***************
*** 956,984 ****
*/
public void addUnit(MoveableGalaxyObject theUnit) {
! if(theUnit.myBranchGroup==null) {
! Node scene = theUnit.getScene();
!
!
! TransformGroup transTG = new TransformGroup();
! transTG.setCapability(TransformGroup.ALLOW_TRANSFORM_READ);
! transTG.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
! transTG.addChild(scene);
!
! theUnit.myUnitMover = new UnitMover(theUnit,transTG,unitMoverThread,this);
!
! BranchGroup container = new BranchGroup();
!
! theUnit.myBranchGroup = container;
! container.setCapability(BranchGroup.ALLOW_DETACH);
- container.addChild(transTG);
- container.setUserData(theUnit);
- container.setPickable(true);
- container.setCapability(Node.ENABLE_PICK_REPORTING);
- container.compile();
! unitBG.addChild(container);
System.out.println("Added Unit at "+theUnit.theLoc.X()+":"+theUnit.theLoc.Y()+":"+theUnit.theLoc.Z());
}
--- 954,972 ----
*/
public void addUnit(MoveableGalaxyObject theUnit) {
! if(!units.containsKey(theUnit)) {
! UnitModel model = null;
! if(theUnit instanceof Settler) {
! model = new SettlerModel((Settler)theUnit,this);
! } else {
! model = new SquadModel();
! }
!
! model.update();
! units.put(theUnit,model);
! unitBG.addChild(model.container);
System.out.println("Added Unit at "+theUnit.theLoc.X()+":"+theUnit.theLoc.Y()+":"+theUnit.theLoc.Z());
}
***************
*** 992,995 ****
--- 980,995 ----
}
+ /** updates showen state of the unit
+ *
+ *@author andybauer
+ *@since 0.0.0pre3
+ */
+ public void updateUnit(MoveableGalaxyObject theObj) {
+ ((UnitModel)units.get(theObj)).update();
+
+
+
+ }
+
/** removes a unit
*
***************
*** 999,1008 ****
*/
public void removeUnit(MoveableGalaxyObject theUnit) {
! if(theUnit.myBranchGroup!=null) {
! theUnit.myBranchGroup.detach();
! theUnit.myBranchGroup=null;
!
! theUnit.myUnitMover.remove();
! theUnit.myUnitMover=null;
}
Enumeration e = plugins.elements();
--- 999,1006 ----
*/
public void removeUnit(MoveableGalaxyObject theUnit) {
! if(units.containsKey(theUnit)) {
! UnitModel model = (UnitModel) units.get(theUnit);
! model.container.detach();
! units.remove(theUnit);
}
Enumeration e = plugins.elements();
Index: EngineTest.java
===================================================================
RCS file: /cvsroot/chaosrts/net/sourceforge/chaosrts/client/galaxy/engine/EngineTest.java,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -d -r1.24 -r1.25
*** EngineTest.java 7 Jun 2002 18:11:55 -0000 1.24
--- EngineTest.java 14 Aug 2002 19:33:30 -0000 1.25
***************
*** 83,87 ****
//tmp2.removeBuilding(structure);
}
! /*
UnitDesign testDesign = new UnitDesign("noname",(Shell)ChaosTree.theChaosTree.shells.get("shell"));
Squad squad = new Squad();
--- 83,87 ----
//tmp2.removeBuilding(structure);
}
!
UnitDesign testDesign = new UnitDesign("noname",(Shell)ChaosTree.theChaosTree.shells.get("shell"));
Squad squad = new Squad();
***************
*** 98,102 ****
squad.path.add(planet.map[13][14]);
tmp2.addUnit(squad);
! **/
Runtime rt = Runtime.getRuntime();
System.out.println(rt.totalMemory()-rt.freeMemory()+"byte of "+rt.totalMemory()+"byte are used. Free: "+rt.freeMemory());
--- 98,102 ----
squad.path.add(planet.map[13][14]);
tmp2.addUnit(squad);
!
Runtime rt = Runtime.getRuntime();
System.out.println(rt.totalMemory()-rt.freeMemory()+"byte of "+rt.totalMemory()+"byte are used. Free: "+rt.freeMemory());
Index: StructureModel.java
===================================================================
RCS file: /cvsroot/chaosrts/net/sourceforge/chaosrts/client/galaxy/engine/StructureModel.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** StructureModel.java 14 May 2002 15:21:24 -0000 1.2
--- StructureModel.java 14 Aug 2002 19:33:30 -0000 1.3
***************
*** 85,89 ****
} catch(Exception e) {
! Debug.debugMsg("Can't load a model for a building");
e.printStackTrace();
}
--- 85,89 ----
} catch(Exception e) {
! Debug.debugMsg("Can't load a model for a building: "+building.model);
e.printStackTrace();
}
--- UnitMover.java DELETED ---
|
|
From: Andreas B. <and...@us...> - 2002-07-24 20:29:55
|
Update of /cvsroot/chaosrts/net/sourceforge/chaosrts/protocol
In directory usw-pr-cvs1:/tmp/cvs-serv1559/net/sourceforge/chaosrts/protocol
Added Files:
DontChacheVector.java
Log Message:
added DontChacheVector
--- NEW FILE: DontChacheVector.java ---
/*
This file is part of Chaotic Domain, an advanced and highly
customizable real-time strategy game written in Java.
Copyright (C) 2001 Andreas Bauer
Chaotic Domain is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
Chaotic Domain is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Chaotic Domain; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
package net.sourceforge.chaosrts.protocol;
import java.util.*;
/** This class is a Vector, which isn't chached in the ChaosStream
*
* @author andybauer
* @since 0.0.0pre3
*/
public class DontChacheVector extends java.util.Vector implements net.sourceforge.chaosrts.protocol.DontCacheMe {
/** Creates a new instance of DontChacheVector */
public DontChacheVector() {
}
public DontChacheVector(Collection c) {
super(c);
}
public DontChacheVector(int initialCapacity) {
super(initialCapacity);
}
public DontChacheVector(int initialCapacity, int capacityIncrement) {
super(initialCapacity, capacityIncrement);
}
}
|
|
From: Andreas B. <and...@us...> - 2002-07-24 10:00:32
|
Update of /cvsroot/chaosrts/net/sourceforge/chaosrts/protocol/galaxy
In directory usw-pr-cvs1:/tmp/cvs-serv28936/net/sourceforge/chaosrts/protocol/galaxy
Modified Files:
LowMoneyAlert.java LowMoraleAlert.java
Log Message:
Index: LowMoneyAlert.java
===================================================================
RCS file: /cvsroot/chaosrts/net/sourceforge/chaosrts/protocol/galaxy/LowMoneyAlert.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** LowMoneyAlert.java 11 Apr 2002 06:26:08 -0000 1.9
--- LowMoneyAlert.java 24 Jul 2002 10:00:29 -0000 1.10
***************
*** 41,44 ****
--- 41,46 ----
this.value=value;
}
+
+ //FIXME LiChaimGuy what exactly means value? //FIXME andybauer inform user of this value
int value;
public String title() {
Index: LowMoraleAlert.java
===================================================================
RCS file: /cvsroot/chaosrts/net/sourceforge/chaosrts/protocol/galaxy/LowMoraleAlert.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** LowMoraleAlert.java 25 Apr 2002 04:24:56 -0000 1.12
--- LowMoraleAlert.java 24 Jul 2002 10:00:29 -0000 1.13
***************
*** 41,45 ****
this.value=value;
}
! /**Morale of the civilization.*/ //FIXME andybauer This changed from value of lower morale bound to the actual morale
public int value;
public String title() {
--- 41,45 ----
this.value=value;
}
! /**Morale of the civilization.*/
public int value;
public String title() {
|
|
From: Andreas B. <and...@us...> - 2002-07-24 10:00:32
|
Update of /cvsroot/chaosrts/net/sourceforge/chaosrts/common
In directory usw-pr-cvs1:/tmp/cvs-serv28936/net/sourceforge/chaosrts/common
Modified Files:
ChaosTree.java ChaosTreeItem.java
Log Message:
Index: ChaosTree.java
===================================================================
RCS file: /cvsroot/chaosrts/net/sourceforge/chaosrts/common/ChaosTree.java,v
retrieving revision 1.50
retrieving revision 1.51
diff -C2 -d -r1.50 -r1.51
*** ChaosTree.java 29 May 2002 19:00:17 -0000 1.50
--- ChaosTree.java 24 Jul 2002 10:00:29 -0000 1.51
***************
*** 172,176 ****
*@since 0.0.0pre2
*/
! public Building defaultBuilding = new Building();
/**Cost of a Settler.
--- 172,176 ----
*@since 0.0.0pre2
*/
! public Building defaultBuilding;
/**Cost of a Settler.
***************
*** 179,183 ****
*@since 0.0.0pre2
*/
! public Commodity settlerCost = new Commodity();
/** The 3D model used by a settler
--- 179,183 ----
*@since 0.0.0pre2
*/
! public Commodity settlerCost;
/** The 3D model used by a settler
***************
*** 192,196 ****
*@since 0.0.0pre2
*/
! public GovernmentType anarchy = new GovernmentType();
/**Default file to load/save this tree;
--- 192,196 ----
*@since 0.0.0pre2
*/
! public GovernmentType anarchy;
/**Default file to load/save this tree;
***************
*** 268,272 ****
groundbuildings = new Hashtable();
createdwith = ChaosTreeItem.CT_VERSION;
!
}
--- 268,274 ----
groundbuildings = new Hashtable();
createdwith = ChaosTreeItem.CT_VERSION;
! anarchy = new GovernmentType();
! defaultBuilding = new Building();
! settlerCost = new Commodity();
}
***************
*** 469,474 ****
--- 471,482 ----
if(createdwith>6) {
anarchy=(GovernmentType)in.readObject();
+ } else {
+ anarchy= new GovernmentType();
}
+ if(createdwith<10) {
+ governmenttypes.put("Anarchy",anarchy);
+
+ }
}
public boolean equals(Object o) {
Index: ChaosTreeItem.java
===================================================================
RCS file: /cvsroot/chaosrts/net/sourceforge/chaosrts/common/ChaosTreeItem.java,v
retrieving revision 1.31
retrieving revision 1.32
diff -C2 -d -r1.31 -r1.32
*** ChaosTreeItem.java 21 Jun 2002 05:58:47 -0000 1.31
--- ChaosTreeItem.java 24 Jul 2002 10:00:29 -0000 1.32
***************
*** 43,52 ****
* From 6 to 7: Added anarchy to ChaosTree
* From 7 to 8: Added image to ChaosTreeItem.
! * From 9 to 9: Added parent to terrain
*
*@author LiChaimGuy (inspired by andybauer)
*@since 0.0.0pre2
*/
! public static final short CT_VERSION=9;
public ChaosTreeItem() {} //Added so that Class.newInstance can be used
public void parentWriteObject(ChaosStream out) throws java.io.IOException {
--- 43,53 ----
* From 6 to 7: Added anarchy to ChaosTree
* From 7 to 8: Added image to ChaosTreeItem.
! * From 8 to 9: Added parent to terrain
! * From 9 to 10: Anarchy is now part of the governments Hashtable.
*
*@author LiChaimGuy (inspired by andybauer)
*@since 0.0.0pre2
*/
! public static final short CT_VERSION=10;
public ChaosTreeItem() {} //Added so that Class.newInstance can be used
public void parentWriteObject(ChaosStream out) throws java.io.IOException {
|
Update of /cvsroot/chaosrts/net/sourceforge/chaosrts/client/galaxy/engine
In directory usw-pr-cvs1:/tmp/cvs-serv28936/net/sourceforge/chaosrts/client/galaxy/engine
Modified Files:
Engine3D.java EnginePlugin.java JAVA.SOURCES
Added Files:
GotoTextListener.java TextListener.java TextManager.java
Log Message:
--- NEW FILE: GotoTextListener.java ---
/*
* GotoTextListener.java
*
* Created on July 20, 2002, 10:22 PM
*/
package net.sourceforge.chaosrts.client.galaxy.engine;
import net.sourceforge.chaosrts.common.*;
/** A TextListener, that let's the Engine look at a location/city/GalaxyObject
*
* @author andybauer
* @since 0.0.0pre3
*/
public class GotoTextListener implements TextListener {
/** The 3D Engine
*
*@author andybauer
*@since 0.0.0pre3
*/
Engine3D theEngine;
/** A location to look at
*
*@author andybauer
*@since 0.0.0pre3
*/
GalaxyLocation location;
/** A city to look at
*
*@author andybauer
*@since 0.0.0pre3
*/
City city;
/** A Galaxy Object to look at
*
*@author andybauer
*@since 0.0.0pre3
*/
GalaxyObject object;
/** Creates a new instance of GotoTextListener
*
*@param location The location to look at
*@param theEngine the 3D Engine
*@author andybauer
*@since 0.0.0pre3
*/
public GotoTextListener(Engine3D theEngine, GalaxyLocation location) {
this.theEngine = theEngine;
this.location = location;
}
/** Creates a new instance of GotoTextListener
*
*@param the city to look at
*@param theEngine the 3D Engine
*@author andybauer
*@since 0.0.0pre3
*/
public GotoTextListener(Engine3D theEngine, City city) {
this.theEngine = theEngine;
this.city = city;
}
/** Creates a new instance of GotoTextListener
*
*@param the GalaxyObject to look at
*@param theEngine the 3D Engine
*@author andybauer
*@since 0.0.0pre3
*/
public GotoTextListener(Engine3D theEngine, GalaxyObject object) {
this.theEngine = theEngine;
this.object = object;
}
/** Let's the Engine look at the location/city/galaxy object.
*
* @param text The text, which was clicked
* @author andybauer
* @since 0.0.0pre3
*/
public void clicked(String text) {
if(location!=null) {
theEngine.lookAt(location);
} else if(city!=null) {
theEngine.lookAt(city.theLoc);
} else {
theEngine.lookAt(object.theLoc);
}
}
}
--- NEW FILE: TextListener.java ---
/*
This file is part of Chaotic Domain, an advanced and highly
customizable real-time strategy game written in Java.
Copyright (C) 2002 Andreas Bauer
Chaotic Domain is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
Chaotic Domain is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Chaotic Domain; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
package net.sourceforge.chaosrts.client.galaxy.engine;
/** Classes wannting to listen on Overlay Text clicks should implement this interface
*
* @author andybauer
*@since 0.0.0pre3
*/
public interface TextListener {
/** Called when ever the text, for which the istener is registied for,is picked
*
*@param text The text, which was clicked
*@author andybauer
*@since 0.0.0pre3
*/
public void clicked(String text);
}
--- NEW FILE: TextManager.java ---
/*
This file is part of Chaotic Domain, an advanced and highly
customizable real-time strategy game written in Java.
Copyright (C) 2002 Andreas Bauer
Chaotic Domain is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
Chaotic Domain is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Chaotic Domain; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
package net.sourceforge.chaosrts.client.galaxy.engine;
import java.awt.*;
/**This class is responsible for managing the text overlay
*
* @author andybauer
* @since 0.0.0pre3
*/
public class TextManager {
/**The 3D Engine to display the text for
*
* @author andybauer
* @since 0.0.0pre3
*/
Engine3D myEngine;
/**The max Number of textes displayed at the same time
*
* @author andybauer
* @since 0.0.0pre3
*/
byte max;
/**The default text display duration
*
*@author andybauer
*qsince 0.0.0pre3
*/
int duration;
/** Creates a new instance of TextManager
*
*@param myEngine the 3D Engine
*@author andybauer
*@since 0.0.0pre3
*/
public TextManager(Engine3D myEngine) {
this.myEngine = myEngine;
}
/** Shows the text
*
*@param text the Text to show
*@param color the Color of the text
*@param font the font stuff of the Text
*@param listener the Text listener; could be null
*@author andybauer
*@since 0.0.0pre3
*/
public void showText(String text, Color color, Font font,TextListener listener) {
}
/** Shows the text with default color and font
*
*@param text the Text to show
*@param listener the Text listener; could be null
*@author andybauer
*@since 0.0.0pre3
*/
public void showNormalText(String text,TextListener listener) {
}
/** Sets the max. number of texts display at the same time
*
*@param max Number of texts displayed
*@author andybauer
*@since 0.0.0pre3
*/
public void setMaxText(byte max) {
this.max = max;
}
/** The default duration a text is display, until it is removed
*
*@author andybauer
*@since 0.0.0pre3
*/
public void setDefaultDuration(int duration) {
this.duration = duration;
}
}
Index: Engine3D.java
===================================================================
RCS file: /cvsroot/chaosrts/net/sourceforge/chaosrts/client/galaxy/engine/Engine3D.java,v
retrieving revision 1.36
retrieving revision 1.37
diff -C2 -d -r1.36 -r1.37
*** Engine3D.java 7 Jun 2002 18:11:55 -0000 1.36
--- Engine3D.java 24 Jul 2002 10:00:29 -0000 1.37
***************
*** 128,138 ****
*/
public PickCanvas pickCanvas;
! /** When the user clicks outside a map we use this canvas and a large shape3d to get the coodinates
! *
! *@author andybauer
! *@since 0.0.0pre2
! */
! public PickCanvas terrainPick;
!
/** The route of the sceneGraph
*
--- 128,132 ----
*/
public PickCanvas pickCanvas;
!
/** The route of the sceneGraph
*
***************
*** 303,306 ****
--- 297,307 ----
public TerrainTextureManager terrainmanager;
+ /** The Overlay Text Manager
+ *
+ *@author andybauer
+ *@since 0.0.0pre3
+ */
+ public TextManager textmanager;
+
/** This Vector contains the new added Grids, for which the Texture Unit State must updated
*
***************
*** 383,388 ****
viewTGrotY.addChild(test.getRoot());
test.initialize();*/
!
!
if(ChaosObject.theProps.getProperty("gc.fps").equals("true")) {
--- 384,406 ----
viewTGrotY.addChild(test.getRoot());
test.initialize();*/
! Font overlayFont = new Font("Arial", Font.BOLD, 12);
! Color overlayColor = new Color(1f,1f,1f,0.8f);
!
!
! LabelOverlay overlay = new LabelOverlay(theCanvas, new Rectangle(0, 0, 300, 32), "Welcome to Chaotic Domain Galaxy Client", overlayFont, overlayColor);
! //without this line the background isn't cleared
! overlay.setBackgroundColor(new Color(0f,0f,0f,0f));
! overlay.setVisible(true);
! viewTGrotY.addChild(overlay.getRoot());
! overlay.repaint();
!
! LabelOverlay overlay2 = new LabelOverlay(theCanvas, new Rectangle(0, 33, 300, 32), "visit us at chaosrts.sourceforge.net", overlayFont, overlayColor);
! //without this line the background isn't cleared
! overlay2.setBackgroundColor(new Color(0f,0f,0f,0f));
! overlay2.setVisible(true);
! viewTGrotY.addChild(overlay2.getRoot());
! overlay2.repaint();
!
! textmanager = new TextManager(this);
if(ChaosObject.theProps.getProperty("gc.fps").equals("true")) {
***************
*** 430,440 ****
theLocal.addBranchGraph(terrainPickBG);
-
- terrainPick = new PickCanvas(theCanvas,terrainPickBG);
- terrainPick.setMode(PickCanvas.GEOMETRY_INTERSECT_INFO);
-
-
-
-
light = new PointLight(new Color3f(Color.white),new Point3f(0,1,0),new Point3f(1,0,0));
light.setInfluencingBoundingLeaf(viewBounding);
--- 448,451 ----
***************
*** 738,759 ****
SceneGraphPath path = null;
-
Node group = null;
! if(res!=null && res.length>0) {
! if(res[0].getSceneGraphPath().getNode(0)==terrainPickBG) {
! if(res.length>1) {
! group=res[1].getSceneGraphPath().getNode(0);
! path = res[1].getSceneGraphPath();
}
-
- } else {
- group=res[0].getSceneGraphPath().getNode(0);
- path=res[0].getSceneGraphPath();
-
}
- } else {
- return;
}
--- 749,784 ----
SceneGraphPath path = null;
Node group = null;
!
! for(int i =0;i<res.length;i++) {
! Node tmpgroup = res[i].getSceneGraphPath().getNode(0);
!
! if(tmpgroup==unitBG||tmpgroup==cityBG||tmpgroup==buildingBG) {
! group=tmpgroup;
! path = res[i].getSceneGraphPath();
! break;
! }
! }
!
! if(group==null) {
! for(int i =0;i<res.length;i++) {
! Node tmpgroup = res[i].getSceneGraphPath().getNode(0);
!
! if(tmpgroup==terrainBG) {
! group=tmpgroup;
! path = res[i].getSceneGraphPath();
! break;
}
}
}
+ if(group==null) {
+ group=res[0].getSceneGraphPath().getNode(0);
+ path = res[0].getSceneGraphPath();
+ }
+
+ if(group==null) {
+ return;
+ }
***************
*** 762,766 ****
System.out.println("Picked at:"+String.valueOf(tmp.X)+"; "+String.valueOf(tmp.Y));
! myClient.gridPicked(tmp);
return;
} else if(group == unitBG) {
--- 787,791 ----
System.out.println("Picked at:"+String.valueOf(tmp.X)+"; "+String.valueOf(tmp.Y));
! myClient.gridPicked(tmp.X,tmp.Y);
return;
} else if(group == unitBG) {
***************
*** 781,793 ****
return;
} else {
! terrainPick.setShapeLocation(mouseEvent);
! PickResult terr = terrainPick.pickClosest();
PickIntersection inter = terr.getIntersection(0);
Point3d point = inter.getPointCoordinatesVW();
- System.out.println("Picked outside discoverd map at "+(short)point.x/2+";"+(short)point.z/2);
- Grid tmp = new Grid(myClient.currPlanet,(short)(point.x/2),(short)(point.z/2));
! myClient.gridPicked(tmp);
}
--- 806,823 ----
return;
} else {
!
! pickCanvas.setMode(PickCanvas.GEOMETRY_INTERSECT_INFO);
! PickResult terr = pickCanvas.pickClosest();
! pickCanvas.setMode(PickCanvas.BOUNDS);
PickIntersection inter = terr.getIntersection(0);
Point3d point = inter.getPointCoordinatesVW();
+ int x = (int) point.x/2;
+ int y = (int) point.z/2;
+ System.out.println("Picked outside discoverd map at "+x+";"+y);
!
! myClient.gridPicked(x,y);
!
}
Index: EnginePlugin.java
===================================================================
RCS file: /cvsroot/chaosrts/net/sourceforge/chaosrts/client/galaxy/engine/EnginePlugin.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** EnginePlugin.java 10 Apr 2002 18:56:15 -0000 1.1
--- EnginePlugin.java 24 Jul 2002 10:00:29 -0000 1.2
***************
*** 56,60 ****
*/
public void addGrid(GalaxyLocation thePos);
! /** called whena Unit is added
*
*@param theObj the added Unit(Squad/Settler)
--- 56,60 ----
*/
public void addGrid(GalaxyLocation thePos);
! /** called when a Unit is added
*
*@param theObj the added Unit(Squad/Settler)
***************
*** 63,67 ****
*/
public void addUnit(MoveableGalaxyObject theObj);
! /** called whena unit is removed
*
*@param theObj the removed Unit(Squad/Settler)
--- 63,67 ----
*/
public void addUnit(MoveableGalaxyObject theObj);
! /** called when a unit is removed
*
*@param theObj the removed Unit(Squad/Settler)
***************
*** 91,95 ****
*/
public void addBuilding(Structure theStructur);
! /** called whena Structur is removed
*
*@param theStructur the removed Structur
--- 91,95 ----
*/
public void addBuilding(Structure theStructur);
! /** called when a Structur is removed
*
*@param theStructur the removed Structur
Index: JAVA.SOURCES
===================================================================
RCS file: /cvsroot/chaosrts/net/sourceforge/chaosrts/client/galaxy/engine/JAVA.SOURCES,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** JAVA.SOURCES 27 May 2002 09:29:04 -0000 1.16
--- JAVA.SOURCES 24 Jul 2002 10:00:29 -0000 1.17
***************
*** 8,9 ****
--- 8,12 ----
StructureModel.java
TerrainTextureManager.java
+ TextManager.java
+ TextListener.java
+ GotoTextListener.java
|
|
From: Andreas B. <and...@us...> - 2002-07-24 10:00:31
|
Update of /cvsroot/chaosrts/net/sourceforge/chaosrts/client/galaxy
In directory usw-pr-cvs1:/tmp/cvs-serv28936/net/sourceforge/chaosrts/client/galaxy
Modified Files:
GalaxyClient.java
Log Message:
Index: GalaxyClient.java
===================================================================
RCS file: /cvsroot/chaosrts/net/sourceforge/chaosrts/client/galaxy/GalaxyClient.java,v
retrieving revision 1.81
retrieving revision 1.82
diff -C2 -d -r1.81 -r1.82
*** GalaxyClient.java 7 Jun 2002 18:11:55 -0000 1.81
--- GalaxyClient.java 24 Jul 2002 10:00:29 -0000 1.82
***************
*** 167,171 ****
*@author andybauer
*/
! TitledBorder cityPanelBorder;
--- 167,178 ----
*@author andybauer
*/
! public TitledBorder cityPanelBorder;
! /**The Text Manager (3D Canvas)
! *
! * @author andybauer
! * @since 0.0.0pre3
! */
! TextManager textmanager;
!
***************
*** 556,560 ****
enginePanel.add(theCanvas,BorderLayout.CENTER);
!
soundEngine = new SoundEngine();
--- 563,567 ----
enginePanel.add(theCanvas,BorderLayout.CENTER);
! textmanager = theEngine.textmanager;
soundEngine = new SoundEngine();
***************
*** 1518,1522 ****
}
! public void gridPicked(Grid theGrid) {
Enumeration e = selectedUnits.elements();
--- 1525,1529 ----
}
! public void gridPicked(int x, int y) {
Enumeration e = selectedUnits.elements();
***************
*** 1524,1528 ****
MoveableGalaxyObject obj = (MoveableGalaxyObject) e.nextElement();
! theManager.sendPacket(new AssignMoveablePacket(serverRoute,obj,theGrid.X,theGrid.Y,0,currPlanet,MoveableGalaxyObject.STATUS_MOVING,null,null,null));
}
--- 1531,1535 ----
MoveableGalaxyObject obj = (MoveableGalaxyObject) e.nextElement();
! theManager.sendPacket(new AssignMoveablePacket(serverRoute,obj,x,y,0,currPlanet,MoveableGalaxyObject.STATUS_MOVING,null,null,null));
}
***************
*** 1613,1622 ****
if(thePacket instanceof LowHousingAlert) {
! //FIXME andybauer add stuff
} else if(thePacket instanceof LowMoneyAlert) {
! //FIXME andybauer add stuff
} else if(thePacket instanceof LowMoraleAlert) {
! //FIXME andybauer add stuff
!
} else if(thePacket instanceof BankUpdatePacket) {
updateBank(((BankUpdatePacket) thePacket).bank);
--- 1620,1628 ----
if(thePacket instanceof LowHousingAlert) {
! lowHousingAlert((LowHousingAlert)thePacket);
} else if(thePacket instanceof LowMoneyAlert) {
! textmanager.showNormalText("Warning: low money",null);
} else if(thePacket instanceof LowMoraleAlert) {
! textmanager.showNormalText("Warning:lLow moral. Mural is now "+((LowMoraleAlert)thePacket).value,null);
} else if(thePacket instanceof BankUpdatePacket) {
updateBank(((BankUpdatePacket) thePacket).bank);
***************
*** 1676,1679 ****
--- 1682,1690 ----
}
+ private void lowHousingAlert(LowHousingAlert alert) {
+ City tmp = alert.theCity;
+ textmanager.showNormalText("Warning: low housing at "+tmp.name,new GotoTextListener(theEngine,tmp));
+ }
+
private void researchChanged(ResearchChangedAlert thePacket) {
researching = thePacket.curr;
***************
*** 1685,1695 ****
private void governmentChanged(GovernmentChangedAlert thePacket) {
govTypesComboBox.setSelectedItem(thePacket.govt);
!
}
private void taxesChanged(TaxesChangedAlert thePacket) {
taxRate = thePacket.taxes;
taxTextField.setText(Short.toString(taxRate));
}
--- 1696,1708 ----
private void governmentChanged(GovernmentChangedAlert thePacket) {
govTypesComboBox.setSelectedItem(thePacket.govt);
! textmanager.showNormalText("The new Government type is"+thePacket.govt.name,null);
}
private void taxesChanged(TaxesChangedAlert thePacket) {
+
taxRate = thePacket.taxes;
taxTextField.setText(Short.toString(taxRate));
+ textmanager.showNormalText("The new tax rate is "+taxRate,null);
}
***************
*** 1727,1730 ****
--- 1740,1744 ----
*/
private void researchCompleteAlert(ResearchCompleteAlert thePacket) {
+ textmanager.showNormalText("We researched "+thePacket.theTech.name,null);
researched.add(thePacket.theTech);
***************
*** 1738,1746 ****
updateBuildList();
-
-
-
-
-
}
--- 1752,1755 ----
***************
*** 1835,1838 ****
--- 1844,1848 ----
*/
private void cityBuild(CityBuiltPacket thePacket) {
+ textmanager.showNormalText("The city "+thePacket.theCity.name+" was founded",new GotoTextListener(theEngine,thePacket.theCity));
City tmp = thePacket.theCity;
((Vector)cities.get(((Grid)tmp.theLoc).thePlanet)).add(tmp);
***************
*** 1869,1872 ****
--- 1879,1884 ----
GalaxyObject produced = thePacket.produced;
+
+ //textmanager.showNormalText(thePacket.theCity.name+" produced "+produced. //FIXME andybauer inform user
try{
((DefaultListModel)prodListModels.get(thePacket.theCity)).removeElementAt(0);
***************
*** 2072,2084 ****
joined = true;
setup();
!
!
!
!
!
! //FIXME remove this patch
! //FIXME andybauer get the govenment combo box working
! //ChaosTree.theChaosTree.governmenttypes.put(ChaosTree.theChaosTree.anarchy.name,ChaosTree.theChaosTree.anarchy);
!
myCiv = thePacket.theCiv;
--- 2084,2088 ----
joined = true;
setup();
!
myCiv = thePacket.theCiv;
***************
*** 2199,2202 ****
--- 2203,2207 ----
if(thePacket.nick == myNick) {
updateMyRights();
+ textmanager.showNormalText("Your rights changed",null);
}
|
|
From: Michael S. <lic...@us...> - 2002-07-23 20:31:04
|
Update of /cvsroot/chaosrts/net/sourceforge/chaosrts/simpleclient
In directory usw-pr-cvs1:/tmp/cvs-serv24192
Added Files:
SquadSelectorDialog.form SquadSelectorDialog.java
Log Message:
Added missing files
--- NEW FILE: SquadSelectorDialog.form ---
<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.0" type="org.netbeans.modules.form.forminfo.DialogFormInfo">
<Properties>
<Property name="name" type="java.lang.String" value="null"/>
<Property name="title" type="java.lang.String" value="Please select the Squad/Settler you wish to control"/>
</Properties>
<SyntheticProperties>
<SyntheticProperty name="formSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,1,44,0,0,1,-112"/>
<SyntheticProperty name="formPosition" type="java.awt.Point" value="-84,-19,0,5,115,114,0,14,106,97,118,97,46,97,119,116,46,80,111,105,110,116,-74,-60,-118,114,52,126,-56,38,2,0,2,73,0,1,120,73,0,1,121,120,112,0,0,0,0,0,0,0,0"/>
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
<SyntheticProperty name="generatePosition" type="boolean" value="true"/>
<SyntheticProperty name="generateSize" type="boolean" value="true"/>
<SyntheticProperty name="generateCenter" type="boolean" value="true"/>
<SyntheticProperty name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,1,44,0,0,1,-112"/>
</SyntheticProperties>
<Events>
<EventHandler event="windowClosing" listener="java.awt.event.WindowListener" parameters="java.awt.event.WindowEvent" handler="closeDialog"/>
</Events>
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
<SubComponents>
<Container class="java.awt.Panel" name="moveablePanel">
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
<BorderConstraints direction="West"/>
</Constraint>
</Constraints>
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
<SubComponents>
<Component class="java.awt.Label" name="moveableLabel">
<Properties>
<Property name="name" type="java.lang.String" value=""/>
<Property name="text" type="java.lang.String" value="Select the squad or settler to move"/>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
<BorderConstraints direction="North"/>
</Constraint>
</Constraints>
</Component>
<Component class="java.awt.List" name="moveableList">
<Events>
<EventHandler event="itemStateChanged" listener="java.awt.event.ItemListener" parameters="java.awt.event.ItemEvent" handler="moveableListItemStateChanged"/>
</Events>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
<BorderConstraints direction="Center"/>
</Constraint>
</Constraints>
</Component>
</SubComponents>
</Container>
<Container class="java.awt.Panel" name="unitPanel">
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
<BorderConstraints direction="East"/>
</Constraint>
</Constraints>
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
<SubComponents>
<Component class="java.awt.Label" name="unitLabel">
<Properties>
<Property name="text" type="java.lang.String" value="The units in the squad you've selected (if applicable):"/>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
<BorderConstraints direction="North"/>
</Constraint>
</Constraints>
</Component>
<Component class="java.awt.List" name="unitList">
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
<BorderConstraints direction="Center"/>
</Constraint>
</Constraints>
</Component>
</SubComponents>
</Container>
<Container class="java.awt.Panel" name="commandPanel">
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
<BorderConstraints direction="South"/>
</Constraint>
</Constraints>
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignFlowLayout"/>
<SubComponents>
<Component class="java.awt.Button" name="okButton">
<Properties>
<Property name="label" type="java.lang.String" value="OK"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="okButtonActionPerformed"/>
</Events>
</Component>
<Component class="java.awt.Button" name="cancelButton">
<Properties>
<Property name="label" type="java.lang.String" value="Cancel"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="cancelButtonActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Container>
</SubComponents>
</Form>
--- NEW FILE: SquadSelectorDialog.java ---
/*
This file is part of Chaotic Domain, an advanced and highly
customizable real-time strategy game written in Java.
Copyright (C) 2001 Michael Snoyman, Andreas Bauer
Chaotic Domain is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
Chaotic Domain is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Chaotic Domain; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
package net.sourceforge.chaosrts.simpleclient;
import net.sourceforge.chaosrts.common.*;
import java.util.*;
/**Allows the user to select which squad he/she wishes to move on a specific Grid.
*
* @author LiChaimGuy
*/
public class SquadSelectorDialog extends java.awt.Dialog {
//Fields
/**The SimpleGrid to look at*/
public SimpleGrid theGrid;
/**The MoveableGalaxyObject that was selected.
*
* This can be null if there are no MoveableGalaxyObject's in this Grid.
*/
public MoveableGalaxyObject mgo;
/**A Vector of all of my Squad's and Settler's here.*/
public Vector choices=new Vector();
/** Creates new form SquadSelectorDialog */
public SquadSelectorDialog(java.awt.Frame parent, SimpleGrid theGrid) {
super(parent, true);
this.theGrid=theGrid;
Enumeration e=theGrid.groundObjects.elements();
while(e.hasMoreElements()) {
MoveableGalaxyObject mgo=(MoveableGalaxyObject)e.nextElement();
if(mgo.theCiv==theGrid.theCiv) //Part of my civ; add it
choices.add(mgo);
}
switch(choices.size()) {
case 0: //I don't have anyone here
System.out.println("No one's here");
closeDialog();
break;
case 1: //I only have one Squad/Settler here; select it
this.mgo=(MoveableGalaxyObject)choices.firstElement();
closeDialog();
break;
default: //I have at least two things here; let user choose
//Display a list of things in the moveableList
e=choices.elements();
while(e.hasMoreElements()) {
Object o=e.nextElement();
if(o instanceof Settler)
moveableList.add("Settler");
else if(o instanceof Squad)
moveableList.add("Squad");
else
System.err.println("Hey idiot! I have an object of type "+o.getClass().getName()+" in SimpleGrid.groundObjects");
}
moveableList.select(0);
selectMoveable(0);
initComponents();
setVisible(true);
}
}
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
private void initComponents() {//GEN-BEGIN:initComponents
moveablePanel = new java.awt.Panel();
moveableLabel = new java.awt.Label();
moveableList = new java.awt.List();
unitPanel = new java.awt.Panel();
unitLabel = new java.awt.Label();
unitList = new java.awt.List();
commandPanel = new java.awt.Panel();
okButton = new java.awt.Button();
cancelButton = new java.awt.Button();
setName("null");
setTitle("Please select the Squad/Settler you wish to control");
addWindowListener(new java.awt.event.WindowAdapter() {
public void windowClosing(java.awt.event.WindowEvent evt) {
closeDialog();
}
});
moveablePanel.setLayout(new java.awt.BorderLayout());
moveableLabel.setName("");
moveableLabel.setText("Select the squad or settler to move");
moveablePanel.add(moveableLabel, java.awt.BorderLayout.NORTH);
moveableList.addItemListener(new java.awt.event.ItemListener() {
public void itemStateChanged(java.awt.event.ItemEvent evt) {
moveableListItemStateChanged(evt);
}
});
moveablePanel.add(moveableList, java.awt.BorderLayout.CENTER);
add(moveablePanel, java.awt.BorderLayout.WEST);
unitPanel.setLayout(new java.awt.BorderLayout());
unitLabel.setText("The units in the squad you've selected (if applicable):");
unitPanel.add(unitLabel, java.awt.BorderLayout.NORTH);
unitPanel.add(unitList, java.awt.BorderLayout.CENTER);
add(unitPanel, java.awt.BorderLayout.EAST);
okButton.setLabel("OK");
okButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
okButtonActionPerformed(evt);
}
});
commandPanel.add(okButton);
cancelButton.setLabel("Cancel");
cancelButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
cancelButtonActionPerformed(evt);
}
});
commandPanel.add(cancelButton);
add(commandPanel, java.awt.BorderLayout.SOUTH);
pack();
}//GEN-END:initComponents
private void cancelButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancelButtonActionPerformed
closeDialog();
}//GEN-LAST:event_cancelButtonActionPerformed
private void okButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_okButtonActionPerformed
mgo=(MoveableGalaxyObject)choices.elementAt(moveableList.getSelectedIndex());
closeDialog();
}//GEN-LAST:event_okButtonActionPerformed
private void moveableListItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_moveableListItemStateChanged
selectMoveable(moveableList.getSelectedIndex());
}//GEN-LAST:event_moveableListItemStateChanged
/**Setup the unitList to reflect the given index.*/
private void selectMoveable(int index) {
unitList.removeAll();
Object o=choices.elementAt(index);
if(o instanceof Squad) {
Enumeration e=((Squad)o).theUnits.elements();
while(e.hasMoreElements())
unitList.add(e.nextElement().toString());
}
}
/** Closes the dialog */
private void closeDialog() {//GEN-FIRST:event_closeDialog
setVisible(false);
dispose();
}//GEN-LAST:event_closeDialog
// Variables declaration - do not modify//GEN-BEGIN:variables
private java.awt.Panel commandPanel;
private java.awt.Button okButton;
private java.awt.List moveableList;
private java.awt.Panel unitPanel;
private java.awt.Panel moveablePanel;
private java.awt.Label unitLabel;
private java.awt.Button cancelButton;
private java.awt.Label moveableLabel;
private java.awt.List unitList;
// End of variables declaration//GEN-END:variables
}
|
|
From: Michael S. <lic...@us...> - 2002-06-21 07:26:04
|
Update of /cvsroot/chaosrts/net/sourceforge/chaosrts/server/galaxy
In directory usw-pr-cvs1:/tmp/cvs-serv23839/sourceforge/chaosrts/server/galaxy
Modified Files:
PathFinder.java
Log Message:
Fixed the bug in the pathfinder
Index: PathFinder.java
===================================================================
RCS file: /cvsroot/chaosrts/net/sourceforge/chaosrts/server/galaxy/PathFinder.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** PathFinder.java 26 Apr 2002 07:59:34 -0000 1.17
--- PathFinder.java 21 Jun 2002 07:26:01 -0000 1.18
***************
*** 61,68 ****
return false;
}
! else
pn.toProc=false;
}
! if (speed[myLoc.type.cat]<=0 || !(getObjectAt(revealedGalaxyObjects,myLoc) instanceof Structure)) {
toProc=false;
return false;
--- 61,69 ----
return false;
}
! else {
pn.toProc=false;
+ }
}
! if (speed[myLoc.type.cat]<=0) {
toProc=false;
return false;
***************
*** 172,176 ****
currY+=stepY;
Grid g=myPlanet.map[currX][currY];
! if(speed[g.type.cat]>0 || getObjectAt(revealedGalaxyObjects,g) instanceof Structure)
isBlocked=true;
else {
--- 173,177 ----
currY+=stepY;
Grid g=myPlanet.map[currX][currY];
! if(speed[g.type.cat]>0 || getObjectAt(revealedGalaxyObjects,g) instanceof Structure) //FIXME lichaimguy Do I really want to do things this way?
isBlocked=true;
else {
***************
*** 351,355 ****
start.process();
}
! catch(DoneProcessing e) {} //Not a problem, just means I'm done processing
}
/**Hashtable of all the PathNode's that exist and should be processed.
--- 352,358 ----
start.process();
}
! catch(DoneProcessing e) {
! e.printStackTrace();
! } //Not a problem, just means I'm done processing
}
/**Hashtable of all the PathNode's that exist and should be processed.
|
|
From: Michael S. <lic...@us...> - 2002-06-21 05:58:51
|
Update of /cvsroot/chaosrts/net/sourceforge/chaosrts/server/galaxy
In directory usw-pr-cvs1:/tmp/cvs-serv2680/sourceforge/chaosrts/server/galaxy
Modified Files:
Civilization.java GalaxyServer.java
Log Message:
Added support for unit movement to simple client. Fixed some minor bugs and found some others.
Index: Civilization.java
===================================================================
RCS file: /cvsroot/chaosrts/net/sourceforge/chaosrts/server/galaxy/Civilization.java,v
retrieving revision 1.100
retrieving revision 1.101
diff -C2 -d -r1.100 -r1.101
*** Civilization.java 7 Jun 2002 18:11:56 -0000 1.100
--- Civilization.java 21 Jun 2002 05:58:47 -0000 1.101
***************
*** 607,610 ****
--- 607,611 ----
else {
MoveableGalaxyObject s=(MoveableGalaxyObject)o;
+ s.getAssignMoveablePacket(asp);
if(s instanceof Squad)
agression=((Squad)s).agression();
Index: GalaxyServer.java
===================================================================
RCS file: /cvsroot/chaosrts/net/sourceforge/chaosrts/server/galaxy/GalaxyServer.java,v
retrieving revision 1.67
retrieving revision 1.68
diff -C2 -d -r1.67 -r1.68
*** GalaxyServer.java 29 May 2002 19:00:23 -0000 1.67
--- GalaxyServer.java 21 Jun 2002 05:58:47 -0000 1.68
***************
*** 244,250 ****
systems=new StarSystem[totalSystems];
for(int i=0;i<totalSystems;i++) {
! Sector s=Sector.getSector((byte)(Math.random()*map.width),(byte)(Math.random()*map.height),(byte)(Math.random()*map.depth),this);
! /* if(!map.systems.containsKey(s)) */
! //More efficient way of doing the above (based on new fields)
if(s.theSystem==null) {
StarSystem ss=new StarSystem(s);
--- 244,249 ----
systems=new StarSystem[totalSystems];
for(int i=0;i<totalSystems;i++) {
! Sector s=Sector.getSector((byte)(Math.random()*(map.width-1)),(byte)(Math.random()*(map.height-1)),(byte)(Math.random()*(map.depth-1)),this);
!
if(s.theSystem==null) {
StarSystem ss=new StarSystem(s);
|
|
From: Michael S. <lic...@us...> - 2002-06-21 05:58:51
|
Update of /cvsroot/chaosrts/net/sourceforge/chaosrts/protocol/galaxy
In directory usw-pr-cvs1:/tmp/cvs-serv2680/sourceforge/chaosrts/protocol/galaxy
Modified Files:
AssignMoveablePacket.java JAVA.SOURCES Makefile
Log Message:
Added support for unit movement to simple client. Fixed some minor bugs and found some others.
Index: AssignMoveablePacket.java
===================================================================
RCS file: /cvsroot/chaosrts/net/sourceforge/chaosrts/protocol/galaxy/AssignMoveablePacket.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** AssignMoveablePacket.java 7 Jun 2002 18:11:56 -0000 1.17
--- AssignMoveablePacket.java 21 Jun 2002 05:58:47 -0000 1.18
***************
*** 107,110 ****
--- 107,123 ----
*/
public byte status;
+ /**Wrapper to the real constructor.*/
+ public AssignMoveablePacket(Route r,MoveableGalaxyObject theObj,GalaxyLocation theLoc,byte stat,String cityName,GroundBuilding theBuilding,Vector cityGrids) {
+ this(r,
+ theObj,
+ theLoc.X(),
+ theLoc.Y(),
+ theLoc.Z(),
+ (theLoc instanceof Grid?((Grid)theLoc).thePlanet:null),
+ stat,
+ cityName,
+ theBuilding,
+ cityGrids);
+ }
public AssignMoveablePacket(Route r,MoveableGalaxyObject theobj,int x, int y, int z,Planet planet,byte stat,String cityname,GroundBuilding thebuilding,Vector citygrids) {
super(r);
Index: JAVA.SOURCES
===================================================================
RCS file: /cvsroot/chaosrts/net/sourceforge/chaosrts/protocol/galaxy/JAVA.SOURCES,v
retrieving revision 1.34
retrieving revision 1.35
diff -C2 -d -r1.34 -r1.35
*** JAVA.SOURCES 26 Apr 2002 20:51:44 -0000 1.34
--- JAVA.SOURCES 21 Jun 2002 05:58:47 -0000 1.35
***************
*** 26,30 ****
DiscoveredStuffPacket.java
EnemySpottedAlert.java
- FederationVotePacket.java
GalaxyDataPacket.java
GameEndedAlert.java
--- 26,29 ----
***************
*** 32,39 ****
GovernmentChangedAlert.java
InsufficientRightsAlert.java
- JoinFederationPacket.java
- JoinFederationRequestAlert.java
JoinGamePacket.java
- JoinedFederationAlert.java
LowHousingAlert.java
LowMoneyAlert.java
--- 31,35 ----
***************
*** 54,55 ****
--- 50,55 ----
YourCivPacket.java
BeginGamePacket.java
+ JoinedFederationAlert.java
+ JoinFederationPacket.java
+ FederationVotePacket.java
+ JoinFederationRequestAlert.java
Index: Makefile
===================================================================
RCS file: /cvsroot/chaosrts/net/sourceforge/chaosrts/protocol/galaxy/Makefile,v
retrieving revision 1.57
retrieving revision 1.58
diff -C2 -d -r1.57 -r1.58
*** Makefile 26 Apr 2002 20:51:44 -0000 1.57
--- Makefile 21 Jun 2002 05:58:47 -0000 1.58
***************
*** 4,9 ****
include ../../../../Makefile.defs
! CLASSES = AIChangedAlert.class AddControllerPacket.class AddPopPoolPacket.class AddTrainingCoursePacket.class AddUnitDesignPacket.class AssignMoveablePacket.class BankUpdatePacket.class BuildStatusUpdatePacket.class ChangeAIPacket.class ChangeControlRightsPacket.class ChangeDefaultsPacket.class ChangeGovernmentPacket.class ChangeProductionQueuePacket.class ChangeResearchPacket.class ChangeTaxesPacket.class CityBuiltPacket.class CivAlertPacket.class CivControlPacket.class CivUpdatePacket.class CivilizationEncounteredAlert.class ControllerNotAddedPacket.class ControllerRequestPacket.class ControllersPacket.class DeadUnitUpdatePacket.class DefaultsChangedAlert.class DiscoveredStuffPacket.class EnemySpottedAlert.class FederationVotePacket.class GalaxyDataPacket.class GameEndedAlert.class GetGalaxyDataPacket.class GovernmentChangedAlert.class InsufficientRightsAlert.class JoinFederationPacket.class JoinFederationRequestAlert.class JoinGamePacket.class JoinedFederationAlert.class LowHousingAlert.class LowMoneyAlert.class LowMoraleAlert.class OfferPeaceTreatyPacket.class PeaceTreatyOfferedAlert.class PopPoolsUpdatePacket.class ProductionCompleteAlert.class ProductionQueueChangedPacket.class ResearchChangedAlert.class ResearchCompleteAlert.class ResearchUpdatePacket.class RightsChangedAlert.class SetViewedLocationPacket.class TaxesChangedAlert.class UnitDesignAddedPacket.class YourCivDeadAlert.class YourCivPacket.class BeginGamePacket.class
! SOURCES = AIChangedAlert.java AddControllerPacket.java AddPopPoolPacket.java AddTrainingCoursePacket.java AddUnitDesignPacket.java AssignMoveablePacket.java BankUpdatePacket.java BuildStatusUpdatePacket.java ChangeAIPacket.java ChangeControlRightsPacket.java ChangeDefaultsPacket.java ChangeGovernmentPacket.java ChangeProductionQueuePacket.java ChangeResearchPacket.java ChangeTaxesPacket.java CityBuiltPacket.java CivAlertPacket.java CivControlPacket.java CivUpdatePacket.java CivilizationEncounteredAlert.java ControllerNotAddedPacket.java ControllerRequestPacket.java ControllersPacket.java DeadUnitUpdatePacket.java DefaultsChangedAlert.java DiscoveredStuffPacket.java EnemySpottedAlert.java FederationVotePacket.java GalaxyDataPacket.java GameEndedAlert.java GetGalaxyDataPacket.java GovernmentChangedAlert.java InsufficientRightsAlert.java JoinFederationPacket.java JoinFederationRequestAlert.java JoinGamePacket.java JoinedFederationAlert.java LowHousingAlert.java LowMoneyAlert.java LowMoraleAlert.java OfferPeaceTreatyPacket.java PeaceTreatyOfferedAlert.java PopPoolsUpdatePacket.java ProductionCompleteAlert.java ProductionQueueChangedPacket.java ResearchChangedAlert.java ResearchCompleteAlert.java ResearchUpdatePacket.java RightsChangedAlert.java SetViewedLocationPacket.java TaxesChangedAlert.java UnitDesignAddedPacket.java YourCivDeadAlert.java YourCivPacket.java BeginGamePacket.java
SUBDIRS =
MAKEGENCONF=../../../../Makefile.defs
--- 4,9 ----
include ../../../../Makefile.defs
! CLASSES = AIChangedAlert.class AddControllerPacket.class AddPopPoolPacket.class AddTrainingCoursePacket.class AddUnitDesignPacket.class AssignMoveablePacket.class BankUpdatePacket.class BuildStatusUpdatePacket.class ChangeAIPacket.class ChangeControlRightsPacket.class ChangeDefaultsPacket.class ChangeGovernmentPacket.class ChangeProductionQueuePacket.class ChangeResearchPacket.class ChangeTaxesPacket.class CityBuiltPacket.class CivAlertPacket.class CivControlPacket.class CivUpdatePacket.class CivilizationEncounteredAlert.class ControllerNotAddedPacket.class ControllerRequestPacket.class ControllersPacket.class DeadUnitUpdatePacket.class DefaultsChangedAlert.class DiscoveredStuffPacket.class EnemySpottedAlert.class GalaxyDataPacket.class GameEndedAlert.class GetGalaxyDataPacket.class GovernmentChangedAlert.class InsufficientRightsAlert.class JoinGamePacket.class LowHousingAlert.class LowMoneyAlert.class LowMoraleAlert.class OfferPeaceTreatyPacket.class PeaceTreatyOfferedAlert.class PopPoolsUpdatePacket.class ProductionCompleteAlert.class ProductionQueueChangedPacket.class ResearchChangedAlert.class ResearchCompleteAlert.class ResearchUpdatePacket.class RightsChangedAlert.class SetViewedLocationPacket.class TaxesChangedAlert.class UnitDesignAddedPacket.class YourCivDeadAlert.class YourCivPacket.class BeginGamePacket.class JoinedFederationAlert.class JoinFederationPacket.class FederationVotePacket.class JoinFederationRequestAlert.class
! SOURCES = AIChangedAlert.java AddControllerPacket.java AddPopPoolPacket.java AddTrainingCoursePacket.java AddUnitDesignPacket.java AssignMoveablePacket.java BankUpdatePacket.java BuildStatusUpdatePacket.java ChangeAIPacket.java ChangeControlRightsPacket.java ChangeDefaultsPacket.java ChangeGovernmentPacket.java ChangeProductionQueuePacket.java ChangeResearchPacket.java ChangeTaxesPacket.java CityBuiltPacket.java CivAlertPacket.java CivControlPacket.java CivUpdatePacket.java CivilizationEncounteredAlert.java ControllerNotAddedPacket.java ControllerRequestPacket.java ControllersPacket.java DeadUnitUpdatePacket.java DefaultsChangedAlert.java DiscoveredStuffPacket.java EnemySpottedAlert.java GalaxyDataPacket.java GameEndedAlert.java GetGalaxyDataPacket.java GovernmentChangedAlert.java InsufficientRightsAlert.java JoinGamePacket.java LowHousingAlert.java LowMoneyAlert.java LowMoraleAlert.java OfferPeaceTreatyPacket.java PeaceTreatyOfferedAlert.java PopPoolsUpdatePacket.java ProductionCompleteAlert.java ProductionQueueChangedPacket.java ResearchChangedAlert.java ResearchCompleteAlert.java ResearchUpdatePacket.java RightsChangedAlert.java SetViewedLocationPacket.java TaxesChangedAlert.java UnitDesignAddedPacket.java YourCivDeadAlert.java YourCivPacket.java BeginGamePacket.java JoinedFederationAlert.java JoinFederationPacket.java FederationVotePacket.java JoinFederationRequestAlert.java
SUBDIRS =
MAKEGENCONF=../../../../Makefile.defs
***************
*** 95,101 ****
$(JAVAC) -classpath ../../../../../ EnemySpottedAlert.java
- FederationVotePacket.class : FederationVotePacket.java
- $(JAVAC) -classpath ../../../../../ FederationVotePacket.java
-
GalaxyDataPacket.class : GalaxyDataPacket.java
$(JAVAC) -classpath ../../../../../ GalaxyDataPacket.java
--- 95,98 ----
***************
*** 113,128 ****
$(JAVAC) -classpath ../../../../../ InsufficientRightsAlert.java
- JoinFederationPacket.class : JoinFederationPacket.java
- $(JAVAC) -classpath ../../../../../ JoinFederationPacket.java
-
- JoinFederationRequestAlert.class : JoinFederationRequestAlert.java
- $(JAVAC) -classpath ../../../../../ JoinFederationRequestAlert.java
-
JoinGamePacket.class : JoinGamePacket.java
$(JAVAC) -classpath ../../../../../ JoinGamePacket.java
- JoinedFederationAlert.class : JoinedFederationAlert.java
- $(JAVAC) -classpath ../../../../../ JoinedFederationAlert.java
-
LowHousingAlert.class : LowHousingAlert.java
$(JAVAC) -classpath ../../../../../ LowHousingAlert.java
--- 110,116 ----
***************
*** 179,183 ****
$(JAVAC) -classpath ../../../../../ BeginGamePacket.java
! compile : AIChangedAlert.class AddControllerPacket.class AddPopPoolPacket.class AddTrainingCoursePacket.class AddUnitDesignPacket.class AssignMoveablePacket.class BankUpdatePacket.class BuildStatusUpdatePacket.class ChangeAIPacket.class ChangeControlRightsPacket.class ChangeDefaultsPacket.class ChangeGovernmentPacket.class ChangeProductionQueuePacket.class ChangeResearchPacket.class ChangeTaxesPacket.class CityBuiltPacket.class CivAlertPacket.class CivControlPacket.class CivUpdatePacket.class CivilizationEncounteredAlert.class ControllerNotAddedPacket.class ControllerRequestPacket.class ControllersPacket.class DeadUnitUpdatePacket.class DefaultsChangedAlert.class DiscoveredStuffPacket.class EnemySpottedAlert.class FederationVotePacket.class GalaxyDataPacket.class GameEndedAlert.class GetGalaxyDataPacket.class GovernmentChangedAlert.class InsufficientRightsAlert.class JoinFederationPacket.class JoinFederationRequestAlert.class JoinGamePacket.class JoinedFederationAlert.class LowHousingAlert.class LowMoneyAlert.class LowMoraleAlert.class OfferPeaceTreatyPacket.class PeaceTreatyOfferedAlert.class PopPoolsUpdatePacket.class ProductionCompleteAlert.class ProductionQueueChangedPacket.class ResearchChangedAlert.class ResearchCompleteAlert.class ResearchUpdatePacket.class RightsChangedAlert.class SetViewedLocationPacket.class TaxesChangedAlert.class UnitDesignAddedPacket.class YourCivDeadAlert.class YourCivPacket.class BeginGamePacket.class $(SUBDIRS)
clean :
--- 167,183 ----
$(JAVAC) -classpath ../../../../../ BeginGamePacket.java
! JoinedFederationAlert.class : JoinedFederationAlert.java
! $(JAVAC) -classpath ../../../../../ JoinedFederationAlert.java
!
! JoinFederationPacket.class : JoinFederationPacket.java
! $(JAVAC) -classpath ../../../../../ JoinFederationPacket.java
!
! FederationVotePacket.class : FederationVotePacket.java
! $(JAVAC) -classpath ../../../../../ FederationVotePacket.java
!
! JoinFederationRequestAlert.class : JoinFederationRequestAlert.java
! $(JAVAC) -classpath ../../../../../ JoinFederationRequestAlert.java
!
! compile : AIChangedAlert.class AddControllerPacket.class AddPopPoolPacket.class AddTrainingCoursePacket.class AddUnitDesignPacket.class AssignMoveablePacket.class BankUpdatePacket.class BuildStatusUpdatePacket.class ChangeAIPacket.class ChangeControlRightsPacket.class ChangeDefaultsPacket.class ChangeGovernmentPacket.class ChangeProductionQueuePacket.class ChangeResearchPacket.class ChangeTaxesPacket.class CityBuiltPacket.class CivAlertPacket.class CivControlPacket.class CivUpdatePacket.class CivilizationEncounteredAlert.class ControllerNotAddedPacket.class ControllerRequestPacket.class ControllersPacket.class DeadUnitUpdatePacket.class DefaultsChangedAlert.class DiscoveredStuffPacket.class EnemySpottedAlert.class GalaxyDataPacket.class GameEndedAlert.class GetGalaxyDataPacket.class GovernmentChangedAlert.class InsufficientRightsAlert.class JoinGamePacket.class LowHousingAlert.class LowMoneyAlert.class LowMoraleAlert.class OfferPeaceTreatyPacket.class PeaceTreatyOfferedAlert.class PopPoolsUpdatePacket.class ProductionCompleteAlert.class ProductionQueueChangedPacket.class ResearchChangedAlert.class ResearchCompleteAlert.class ResearchUpdatePacket.class RightsChangedAlert.class SetViewedLocationPacket.class TaxesChangedAlert.class UnitDesignAddedPacket.class YourCivDeadAlert.class YourCivPacket.class BeginGamePacket.class JoinedFederationAlert.class JoinFederationPacket.class FederationVotePacket.class JoinFederationRequestAlert.class $(SUBDIRS)
clean :
|
|
From: Michael S. <lic...@us...> - 2002-06-21 05:58:51
|
Update of /cvsroot/chaosrts/net/sourceforge/chaosrts/simpleclient
In directory usw-pr-cvs1:/tmp/cvs-serv2680/sourceforge/chaosrts/simpleclient
Modified Files:
JAVA.SOURCES Makefile NewCivDialog.java
SimpleGalaxyClient.form SimpleGalaxyClient.java
SimpleGrid.java
Log Message:
Added support for unit movement to simple client. Fixed some minor bugs and found some others.
Index: JAVA.SOURCES
===================================================================
RCS file: /cvsroot/chaosrts/net/sourceforge/chaosrts/simpleclient/JAVA.SOURCES,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** JAVA.SOURCES 26 Apr 2002 20:51:44 -0000 1.6
--- JAVA.SOURCES 21 Jun 2002 05:58:48 -0000 1.7
***************
*** 1,14 ****
ChatClientConfigDialog.java
ConfirmExitDialog.java
MessageDialog.java
- SimpleChatClient.java
GameListDialog.java
- GridCanvas.java
- JoinGameDialog.java
SimpleGalaxyClient.java
! SimpleGrid.java
! SimplePlanet.java
TextInputDialog.java
YesNoDialog.java
GridInfoPanel.java
ListDialog.java
--- 1,16 ----
+ SimpleChatClient.java
ChatClientConfigDialog.java
ConfirmExitDialog.java
MessageDialog.java
GameListDialog.java
SimpleGalaxyClient.java
! JoinGameDialog.java
TextInputDialog.java
YesNoDialog.java
+ GridCanvas.java
+ SimplePlanet.java
+ SimpleGrid.java
GridInfoPanel.java
ListDialog.java
+ NewCivDialog.java
+ SquadSelectorDialog.java
Index: Makefile
===================================================================
RCS file: /cvsroot/chaosrts/net/sourceforge/chaosrts/simpleclient/Makefile,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** Makefile 26 Apr 2002 20:51:45 -0000 1.6
--- Makefile 21 Jun 2002 05:58:48 -0000 1.7
***************
*** 4,9 ****
include ../../../Makefile.defs
! CLASSES = ChatClientConfigDialog.class ConfirmExitDialog.class MessageDialog.class SimpleChatClient.class GameListDialog.class GridCanvas.class JoinGameDialog.class SimpleGalaxyClient.class SimpleGrid.class SimplePlanet.class TextInputDialog.class YesNoDialog.class GridInfoPanel.class ListDialog.class
! SOURCES = ChatClientConfigDialog.java ConfirmExitDialog.java MessageDialog.java SimpleChatClient.java GameListDialog.java GridCanvas.java JoinGameDialog.java SimpleGalaxyClient.java SimpleGrid.java SimplePlanet.java TextInputDialog.java YesNoDialog.java GridInfoPanel.java ListDialog.java
SUBDIRS =
MAKEGENCONF=../../../Makefile.defs
--- 4,9 ----
include ../../../Makefile.defs
! CLASSES = SimpleChatClient.class ChatClientConfigDialog.class ConfirmExitDialog.class MessageDialog.class GameListDialog.class SimpleGalaxyClient.class JoinGameDialog.class TextInputDialog.class YesNoDialog.class GridCanvas.class SimplePlanet.class SimpleGrid.class GridInfoPanel.class ListDialog.class NewCivDialog.class SquadSelectorDialog.class
! SOURCES = SimpleChatClient.java ChatClientConfigDialog.java ConfirmExitDialog.java MessageDialog.java GameListDialog.java SimpleGalaxyClient.java JoinGameDialog.java TextInputDialog.java YesNoDialog.java GridCanvas.java SimplePlanet.java SimpleGrid.java GridInfoPanel.java ListDialog.java NewCivDialog.java SquadSelectorDialog.java
SUBDIRS =
MAKEGENCONF=../../../Makefile.defs
***************
*** 14,17 ****
--- 14,20 ----
all : fullcompile
+ SimpleChatClient.class : SimpleChatClient.java
+ $(JAVAC) -classpath ../../../../ SimpleChatClient.java
+
ChatClientConfigDialog.class : ChatClientConfigDialog.java
$(JAVAC) -classpath ../../../../ ChatClientConfigDialog.java
***************
*** 23,46 ****
$(JAVAC) -classpath ../../../../ MessageDialog.java
- SimpleChatClient.class : SimpleChatClient.java
- $(JAVAC) -classpath ../../../../ SimpleChatClient.java
-
GameListDialog.class : GameListDialog.java
$(JAVAC) -classpath ../../../../ GameListDialog.java
- GridCanvas.class : GridCanvas.java
- $(JAVAC) -classpath ../../../../ GridCanvas.java
-
- JoinGameDialog.class : JoinGameDialog.java
- $(JAVAC) -classpath ../../../../ JoinGameDialog.java
-
SimpleGalaxyClient.class : SimpleGalaxyClient.java
$(JAVAC) -classpath ../../../../ SimpleGalaxyClient.java
! SimpleGrid.class : SimpleGrid.java
! $(JAVAC) -classpath ../../../../ SimpleGrid.java
!
! SimplePlanet.class : SimplePlanet.java
! $(JAVAC) -classpath ../../../../ SimplePlanet.java
TextInputDialog.class : TextInputDialog.java
--- 26,37 ----
$(JAVAC) -classpath ../../../../ MessageDialog.java
GameListDialog.class : GameListDialog.java
$(JAVAC) -classpath ../../../../ GameListDialog.java
SimpleGalaxyClient.class : SimpleGalaxyClient.java
$(JAVAC) -classpath ../../../../ SimpleGalaxyClient.java
! JoinGameDialog.class : JoinGameDialog.java
! $(JAVAC) -classpath ../../../../ JoinGameDialog.java
TextInputDialog.class : TextInputDialog.java
***************
*** 50,53 ****
--- 41,53 ----
$(JAVAC) -classpath ../../../../ YesNoDialog.java
+ GridCanvas.class : GridCanvas.java
+ $(JAVAC) -classpath ../../../../ GridCanvas.java
+
+ SimplePlanet.class : SimplePlanet.java
+ $(JAVAC) -classpath ../../../../ SimplePlanet.java
+
+ SimpleGrid.class : SimpleGrid.java
+ $(JAVAC) -classpath ../../../../ SimpleGrid.java
+
GridInfoPanel.class : GridInfoPanel.java
$(JAVAC) -classpath ../../../../ GridInfoPanel.java
***************
*** 56,60 ****
$(JAVAC) -classpath ../../../../ ListDialog.java
! compile : ChatClientConfigDialog.class ConfirmExitDialog.class MessageDialog.class SimpleChatClient.class GameListDialog.class GridCanvas.class JoinGameDialog.class SimpleGalaxyClient.class SimpleGrid.class SimplePlanet.class TextInputDialog.class YesNoDialog.class GridInfoPanel.class ListDialog.class $(SUBDIRS)
clean :
--- 56,66 ----
$(JAVAC) -classpath ../../../../ ListDialog.java
! NewCivDialog.class : NewCivDialog.java
! $(JAVAC) -classpath ../../../../ NewCivDialog.java
!
! SquadSelectorDialog.class : SquadSelectorDialog.java
! $(JAVAC) -classpath ../../../../ SquadSelectorDialog.java
!
! compile : SimpleChatClient.class ChatClientConfigDialog.class ConfirmExitDialog.class MessageDialog.class GameListDialog.class SimpleGalaxyClient.class JoinGameDialog.class TextInputDialog.class YesNoDialog.class GridCanvas.class SimplePlanet.class SimpleGrid.class GridInfoPanel.class ListDialog.class NewCivDialog.class SquadSelectorDialog.class $(SUBDIRS)
clean :
Index: NewCivDialog.java
===================================================================
RCS file: /cvsroot/chaosrts/net/sourceforge/chaosrts/simpleclient/NewCivDialog.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** NewCivDialog.java 26 Apr 2002 06:57:18 -0000 1.1
--- NewCivDialog.java 21 Jun 2002 05:58:48 -0000 1.2
***************
*** 45,48 ****
--- 45,58 ----
theClient=parent;
initComponents();
+
+ //Randomize the color
+ redField.setText(Integer.toString((int)(Math.random()*256)));
+ greenField.setText(Integer.toString((int)(Math.random()*256)));
+ blueField.setText(Integer.toString((int)(Math.random()*256)));
+
+ //Redisplay with new, random color
+ repaint();
+
+ //Display the dialog
setSize(400,400);
setVisible(true);
Index: SimpleGalaxyClient.form
===================================================================
RCS file: /cvsroot/chaosrts/net/sourceforge/chaosrts/simpleclient/SimpleGalaxyClient.form,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** SimpleGalaxyClient.form 25 Apr 2002 00:10:47 -0000 1.5
--- SimpleGalaxyClient.form 21 Jun 2002 05:58:48 -0000 1.6
***************
*** 61,64 ****
--- 61,87 ----
</SubComponents>
</Container>
+ <Container class="java.awt.Panel" name="moverCommands">
+
+ <Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridLayout">
+ <Property name="columns" type="int" value="0"/>
+ <Property name="rows" type="int" value="3"/>
+ </Layout>
+ <SubComponents>
+ <Component class="java.awt.Label" name="moverLabel">
+ <Properties>
+ <Property name="text" type="java.lang.String" value="Unit Commands:"/>
+ </Properties>
+ </Component>
+ <Component class="java.awt.Button" name="moveButton">
+ <Properties>
+ <Property name="label" type="java.lang.String" value="Move"/>
+ </Properties>
+
+ <Events>
+ <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="moveButtonActionPerformed"/>
+ </Events>
+ </Component>
+ </SubComponents>
+ </Container>
<Container class="java.awt.Panel" name="settlerCommands">
Index: SimpleGalaxyClient.java
===================================================================
RCS file: /cvsroot/chaosrts/net/sourceforge/chaosrts/simpleclient/SimpleGalaxyClient.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** SimpleGalaxyClient.java 30 Apr 2002 04:27:33 -0000 1.13
--- SimpleGalaxyClient.java 21 Jun 2002 05:58:48 -0000 1.14
***************
*** 151,154 ****
--- 151,157 ----
civCommandsLabel = new java.awt.Label();
techButton = new java.awt.Button();
+ moverCommands = new java.awt.Panel();
+ moverLabel = new java.awt.Label();
+ moveButton = new java.awt.Button();
settlerCommands = new java.awt.Panel();
settlerCommandsLabel = new java.awt.Label();
***************
*** 187,190 ****
--- 190,209 ----
commandPanel.add(civCommands);
+ moverCommands.setLayout(new java.awt.GridLayout(3, 0));
+
+ moverLabel.setText("Unit Commands:");
+ moverCommands.add(moverLabel);
+
+ moveButton.setLabel("Move");
+ moveButton.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ moveButtonActionPerformed(evt);
+ }
+ });
+
+ moverCommands.add(moveButton);
+
+ commandPanel.add(moverCommands);
+
settlerCommands.setLayout(new java.awt.GridLayout(3, 1));
***************
*** 292,295 ****
--- 311,335 ----
}//GEN-END:initComponents
+ private void moveButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_moveButtonActionPerformed
+ System.err.println("Clicked the move button");
+ final MoveableGalaxyObject mgo=(new SquadSelectorDialog(this,selectedGrid)).mgo;
+ if(mgo==null)
+ return;
+ getClickedGrid(new GridClickedListener() {
+ void gridClicked(SimpleGrid grid) {
+ System.err.println("Grid selected to move to");
+ Grid destGrid=(grid==null?null:grid.theGrid);
+ if(destGrid!=null) //We have the MGO and the destination, send it off
+ System.err.println("Grid's not null");
+ theManager.sendPacket(new AssignMoveablePacket
+ (serverRoute,
+ mgo,
+ destGrid,
+ MoveableGalaxyObject.STATUS_MOVING,
+ null,null,null));
+ }
+ });
+ }//GEN-LAST:event_moveButtonActionPerformed
+
private void buildGroundBuildingButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buildGroundBuildingButtonActionPerformed
Settler theSett=selectedGrid.theSettler;
***************
*** 321,325 ****
Vector cityGrids=new Vector(); //FIXME Get Grid's for the city
! cityGrids.add(selectedGrid);
//Found a Settler; give it the build city command and exit
--- 361,365 ----
Vector cityGrids=new Vector(); //FIXME Get Grid's for the city
! cityGrids.add(selectedGrid.theGrid);
//Found a Settler; give it the build city command and exit
***************
*** 372,380 ****
--- 412,423 ----
private java.awt.Panel civCommands;
private java.awt.Panel southPanel;
+ private java.awt.Label moverLabel;
private java.awt.Panel centerPanel;
private java.awt.Panel settlerCommands;
private java.awt.Scrollbar mapHorizScroll;
+ private java.awt.Panel moverCommands;
private java.awt.Label commandLabel;
private java.awt.Button techButton;
+ private java.awt.Button moveButton;
private java.awt.Label civCommandsLabel;
private java.awt.Scrollbar mapVertScroll;
***************
*** 399,402 ****
--- 442,463 ----
theManager.directConnect(g.host.id);
}
+
+ /**An interface representing what to do when a Grid is clicked.*/
+ abstract class GridClickedListener {
+ abstract void gridClicked(SimpleGrid theGrid);
+ }
+
+ /**The current thing to do when a Grid is clicked.
+ *
+ * If null, just display the selected Grid.
+ *
+ */
+ private GridClickedListener gridClicked=null;
+
+ /**Sets it so that gridClicked is called next time a grid is selected.*/
+ public void getClickedGrid(GridClickedListener gridClicked) {
+ this.gridClicked=gridClicked;
+ commandLabel.setText("Please select a grid to complete the given command");
+ }
public void receivePacket(ParentPacket p) {
***************
*** 456,460 ****
}
! /**Change the command panel and grid panel to reflect the newly selected grid.
*
*@author LiChaimGuy
--- 517,525 ----
}
! /**What to do when a Grid is clicked.
! *
! * If gridClicked is null, change the command panel and grid panel
! * to reflect the newly selected grid. Otherwise, call
! * gridClicked.gridClicked() and set gridClicked to null.
*
*@author LiChaimGuy
***************
*** 462,469 ****
*/
void setSelectedGrid(SimpleGrid g) {
! selectedGrid=g;
! redisplay(topLeft,false);
!
! //FIXME lichaimguy Change the command panel to reflect newly selected grid
}
--- 527,541 ----
*/
void setSelectedGrid(SimpleGrid g) {
! if(gridClicked==null) {
! selectedGrid=g;
! redisplay(topLeft,false);
!
! //FIXME lichaimguy Change the command panel to reflect newly selected grid
! }
! else {
! gridClicked.gridClicked(g);
! gridClicked=null;
! commandLabel.setText("Available Commands:");
! }
}
***************
*** 529,532 ****
--- 601,608 ----
private SimpleGrid getSimpleGrid(Grid g) {
SimplePlanet sp=(SimplePlanet)allPlanets.get(g.thePlanet);
+ if(sp==null) {
+ net.sourceforge.chaosrts.Debug.debugMsg("Weird... we're missing a SimplePlanet");
+ return null;
+ }
return sp.getGrid(g.X(),g.Y());
}
Index: SimpleGrid.java
===================================================================
RCS file: /cvsroot/chaosrts/net/sourceforge/chaosrts/simpleclient/SimpleGrid.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** SimpleGrid.java 29 May 2002 05:14:35 -0000 1.4
--- SimpleGrid.java 21 Jun 2002 05:58:48 -0000 1.5
***************
*** 64,67 ****
--- 64,69 ----
*/
public void generateFields(Civilization theCiv) {
+ this.theCiv=theCiv;
+
//Reset all fields
enemiesPresent=false; //We'll decide if it's otherwise in a second
***************
*** 110,113 ****
--- 112,117 ----
*/
Grid theGrid;
+ /**My civilization.*/
+ public Civilization theCiv;
public SimpleGrid(Grid g,SimplePlanet sp) {
|
|
From: Michael S. <lic...@us...> - 2002-06-21 05:58:50
|
Update of /cvsroot/chaosrts/net/sourceforge/chaosrts/protocol/generator In directory usw-pr-cvs1:/tmp/cvs-serv2680/sourceforge/chaosrts/protocol/generator Modified Files: JAVA.SOURCES Makefile Log Message: Added support for unit movement to simple client. Fixed some minor bugs and found some others. Index: JAVA.SOURCES =================================================================== RCS file: /cvsroot/chaosrts/net/sourceforge/chaosrts/protocol/generator/JAVA.SOURCES,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** JAVA.SOURCES 26 Apr 2002 20:51:44 -0000 1.5 --- JAVA.SOURCES 21 Jun 2002 05:58:47 -0000 1.6 *************** *** 1,2 **** - Convert.java Generator.java --- 1,2 ---- Generator.java + Convert.java Index: Makefile =================================================================== RCS file: /cvsroot/chaosrts/net/sourceforge/chaosrts/protocol/generator/Makefile,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Makefile 26 Apr 2002 20:51:44 -0000 1.5 --- Makefile 21 Jun 2002 05:58:47 -0000 1.6 *************** *** 4,9 **** include ../../../../Makefile.defs ! CLASSES = Convert.class Generator.class ! SOURCES = Convert.java Generator.java SUBDIRS = MAKEGENCONF=../../../../Makefile.defs --- 4,9 ---- include ../../../../Makefile.defs ! CLASSES = Generator.class Convert.class ! SOURCES = Generator.java Convert.java SUBDIRS = MAKEGENCONF=../../../../Makefile.defs *************** *** 14,24 **** all : fullcompile - Convert.class : Convert.java - $(JAVAC) -classpath ../../../../../ Convert.java - Generator.class : Generator.java $(JAVAC) -classpath ../../../../../ Generator.java ! compile : Convert.class Generator.class $(SUBDIRS) clean : --- 14,24 ---- all : fullcompile Generator.class : Generator.java $(JAVAC) -classpath ../../../../../ Generator.java ! Convert.class : Convert.java ! $(JAVAC) -classpath ../../../../../ Convert.java ! ! compile : Generator.class Convert.class $(SUBDIRS) clean : |
|
From: Michael S. <lic...@us...> - 2002-06-21 05:58:50
|
Update of /cvsroot/chaosrts/net/sourceforge/chaosrts/protocol
In directory usw-pr-cvs1:/tmp/cvs-serv2680/sourceforge/chaosrts/protocol
Modified Files:
ConnectionManager.java JAVA.SOURCES Makefile
Log Message:
Added support for unit movement to simple client. Fixed some minor bugs and found some others.
Index: ConnectionManager.java
===================================================================
RCS file: /cvsroot/chaosrts/net/sourceforge/chaosrts/protocol/ConnectionManager.java,v
retrieving revision 1.49
retrieving revision 1.50
diff -C2 -d -r1.49 -r1.50
*** ConnectionManager.java 19 Apr 2002 21:28:46 -0000 1.49
--- ConnectionManager.java 21 Jun 2002 05:58:47 -0000 1.50
***************
*** 386,482 ****
String thePassword,
boolean fromWebsite) throws NoServerSocketException,NotConnectedException {
! myPort=myport;
! if(fromWebsite) {
! hostname="default";
! }
! boolean useWebsite=false;
! boolean setServer=hostname.equals("default");
! boolean loggedOn=false;
! for(int i=0;i<1;i++) {
! if(useWebsite || (setServer && !isMaster)) {
! useWebsite=true;
! try {
! URL getserver=new URL("http://chaosrts.sourceforge.net/cgi-bin/getserver.pl");
! URLConnection urlin=getserver.openConnection();
! BufferedReader in=new BufferedReader(new InputStreamReader(urlin.getInputStream()));
! String serverInfo=in.readLine();
! in.close();
! if(serverInfo.length()<3)
! throw new Exception();
! int index=serverInfo.indexOf(":");
! if(index==-1)
! throw new Exception();
! hostname=serverInfo.substring(0,index);
! serverport=Integer.parseInt(serverInfo.substring(index+1));
! }
! catch(MalformedURLException e) {
! e.printStackTrace();
! }
! catch(IOException e) {
! e.printStackTrace();
! }
! catch(Exception e) { //Some other exception
! }
! }
!
! theListener=thelistener;
! if(!isMaster) {
! try {
! ActiveConnection ac=new ActiveConnection(this,hostname,serverport,proposedCData,thePassword);
! }
! catch(NotConnectedException nce) {
! nce.printStackTrace();
! if(theListener.canBeMaster())
! isMaster=true;
! else {
! if(!theListener.startMasterServer())
! throw nce;
! if(useWebsite)
! System.err.println("The server listed on the website did not work, I'm starting my own.");
! else
! System.err.println("The server you specified did not work, I'm starting my own.");
! hostname="127.0.0.1";
! serverport=4444;
! useWebsite=false;
! setServer=false;
! i--;
! continue;
! }
! }
}
! if(isMaster) { //There is a method to my madness here; look above
! //Load up passwords
! backupFile=backupfile;
! if(backupFile!=null) {
try {
! ChaosStream in=new ChaosStream(new FileInputStream(backupFile),false);
! passwords=(Hashtable)in.readObject();
in.close();
}
catch(IOException e) {
! // e.printStackTrace();
}
}
! myConnectorData=new ConnectorData(ConnectorData.CHAT_SERVER,1);
! if(setServer) {
try {
! URL setserver=new URL("http://chaosrts.sourceforge.net/cgi-bin/setserver.pl?server="+getExternalAddress()+":"+Integer.toString(myPort));
! URLConnection urlout=setserver.openConnection();
! //I think this is necesary for it to work
! BufferedReader in=new BufferedReader(new InputStreamReader(urlout.getInputStream()));
! in.readLine();
}
! catch(MalformedURLException e) {
! e.printStackTrace();
}
! catch(IOException e) {
! e.printStackTrace();
}
}
}
! loggedOn=true;
}
- if(myport>0)
- new ChaosServerSocket(this,myport);
}
/**If this is the master node, where I backup my passwords.
--- 386,492 ----
String thePassword,
boolean fromWebsite) throws NoServerSocketException,NotConnectedException {
! try { //I'm going to re-throw any Exceptions I get, I just want to close all connections too.
! myPort=myport;
! if(fromWebsite) {
! hostname="default";
}
! boolean useWebsite=false;
! boolean setServer=hostname.equals("default");
! boolean loggedOn=false;
! for(int i=0;i<1;i++) {
! if(useWebsite || (setServer && !isMaster)) {
! useWebsite=true;
try {
! URL getserver=new URL("http://chaosrts.sourceforge.net/cgi-bin/getserver.pl");
! URLConnection urlin=getserver.openConnection();
! BufferedReader in=new BufferedReader(new InputStreamReader(urlin.getInputStream()));
! String serverInfo=in.readLine();
in.close();
+ if(serverInfo.length()<3)
+ throw new Exception();
+ int index=serverInfo.indexOf(":");
+ if(index==-1)
+ throw new Exception();
+ hostname=serverInfo.substring(0,index);
+ serverport=Integer.parseInt(serverInfo.substring(index+1));
+ }
+ catch(MalformedURLException e) {
+ e.printStackTrace();
}
catch(IOException e) {
! e.printStackTrace();
! }
! catch(Exception e) { //Some other exception
}
}
!
! theListener=thelistener;
! if(!isMaster) {
try {
! ActiveConnection ac=new ActiveConnection(this,hostname,serverport,proposedCData,thePassword);
}
! catch(NotConnectedException nce) {
! nce.printStackTrace();
! if(theListener.canBeMaster())
! isMaster=true;
! else {
! if(!theListener.startMasterServer())
! throw nce;
! if(useWebsite)
! System.err.println("The server listed on the website did not work, I'm starting my own.");
! else
! System.err.println("The server you specified did not work, I'm starting my own.");
! hostname="127.0.0.1";
! serverport=4444;
! useWebsite=false;
! setServer=false;
! i--;
! continue;
! }
}
! }
! if(isMaster) { //There is a method to my madness here; look above
! //Load up passwords
! backupFile=backupfile;
! if(backupFile!=null) {
! try {
! ChaosStream in=new ChaosStream(new FileInputStream(backupFile),false);
! passwords=(Hashtable)in.readObject();
! in.close();
! }
! catch(IOException e) {
! // e.printStackTrace();
! }
! }
! myConnectorData=new ConnectorData(ConnectorData.CHAT_SERVER,1);
! if(setServer) {
! try {
! URL setserver=new URL("http://chaosrts.sourceforge.net/cgi-bin/setserver.pl?server="+getExternalAddress()+":"+Integer.toString(myPort));
! URLConnection urlout=setserver.openConnection();
! //I think this is necesary for it to work
! BufferedReader in=new BufferedReader(new InputStreamReader(urlout.getInputStream()));
! in.readLine();
! }
! catch(MalformedURLException e) {
! e.printStackTrace();
! }
! catch(IOException e) {
! e.printStackTrace();
! }
}
}
+ loggedOn=true;
}
! if(myport>0)
! new ChaosServerSocket(this,myport);
! }
! catch(NoServerSocketException nsse) {
! closeAllConnections();
! throw nsse;
! }
! catch(NotConnectedException nce) {
! closeAllConnections();
! throw nce;
}
}
/**If this is the master node, where I backup my passwords.
Index: JAVA.SOURCES
===================================================================
RCS file: /cvsroot/chaosrts/net/sourceforge/chaosrts/protocol/JAVA.SOURCES,v
retrieving revision 1.31
retrieving revision 1.32
diff -C2 -d -r1.31 -r1.32
*** JAVA.SOURCES 26 Apr 2002 20:51:44 -0000 1.31
--- JAVA.SOURCES 21 Jun 2002 05:58:47 -0000 1.32
***************
*** 5,9 ****
ChaosIOException.java
ChaosStream.java
- CheckDeepEqual.java
ClientConnectorData.java
ConnectionClosedPacket.java
--- 5,8 ----
***************
*** 13,17 ****
ConnectorData.java
DontCacheMe.java
- Immutable.java
LogonPacket.java
NoRouteToHostPacket.java
--- 12,15 ----
***************
*** 26,28 ****
--- 24,28 ----
TerminatePacket.java
UpdateStuffPacket.java
+ Immutable.java
+ CheckDeepEqual.java
DummyPacket.java
Index: Makefile
===================================================================
RCS file: /cvsroot/chaosrts/net/sourceforge/chaosrts/protocol/Makefile,v
retrieving revision 1.66
retrieving revision 1.67
diff -C2 -d -r1.66 -r1.67
*** Makefile 26 Apr 2002 20:51:44 -0000 1.66
--- Makefile 21 Jun 2002 05:58:47 -0000 1.67
***************
*** 4,9 ****
include ../../../Makefile.defs
! CLASSES = ActiveConnection.class ChangeIDPacket.class ChangeOtherSidePacket.class ChaosEnumeration.class ChaosIOException.class ChaosStream.class CheckDeepEqual.class ClientConnectorData.class ConnectionClosedPacket.class ConnectionListener.class ConnectionManager.class ConnectionOpenedPacket.class ConnectorData.class DontCacheMe.class Immutable.class LogonPacket.class NoRouteToHostPacket.class NoServerSocketException.class NotConnectedException.class ParentPacket.class ParentSerializable.class ReadOnly.class ReceiveIPsPacket.class Route.class SendIPsPacket.class TerminatePacket.class UpdateStuffPacket.class DummyPacket.class
! SOURCES = ActiveConnection.java ChangeIDPacket.java ChangeOtherSidePacket.java ChaosEnumeration.java ChaosIOException.java ChaosStream.java CheckDeepEqual.java ClientConnectorData.java ConnectionClosedPacket.java ConnectionListener.java ConnectionManager.java ConnectionOpenedPacket.java ConnectorData.java DontCacheMe.java Immutable.java LogonPacket.java NoRouteToHostPacket.java NoServerSocketException.java NotConnectedException.java ParentPacket.java ParentSerializable.java ReadOnly.java ReceiveIPsPacket.java Route.java SendIPsPacket.java TerminatePacket.java UpdateStuffPacket.java DummyPacket.java
SUBDIRS = chat galaxy generator
MAKEGENCONF=../../../Makefile.defs
--- 4,9 ----
include ../../../Makefile.defs
! CLASSES = ActiveConnection.class ChangeIDPacket.class ChangeOtherSidePacket.class ChaosEnumeration.class ChaosIOException.class ChaosStream.class ClientConnectorData.class ConnectionClosedPacket.class ConnectionListener.class ConnectionManager.class ConnectionOpenedPacket.class ConnectorData.class DontCacheMe.class LogonPacket.class NoRouteToHostPacket.class NoServerSocketException.class NotConnectedException.class ParentPacket.class ParentSerializable.class ReadOnly.class ReceiveIPsPacket.class Route.class SendIPsPacket.class TerminatePacket.class UpdateStuffPacket.class Immutable.class CheckDeepEqual.class DummyPacket.class
! SOURCES = ActiveConnection.java ChangeIDPacket.java ChangeOtherSidePacket.java ChaosEnumeration.java ChaosIOException.java ChaosStream.java ClientConnectorData.java ConnectionClosedPacket.java ConnectionListener.java ConnectionManager.java ConnectionOpenedPacket.java ConnectorData.java DontCacheMe.java LogonPacket.java NoRouteToHostPacket.java NoServerSocketException.java NotConnectedException.java ParentPacket.java ParentSerializable.java ReadOnly.java ReceiveIPsPacket.java Route.java SendIPsPacket.java TerminatePacket.java UpdateStuffPacket.java Immutable.java CheckDeepEqual.java DummyPacket.java
SUBDIRS = chat galaxy generator
MAKEGENCONF=../../../Makefile.defs
***************
*** 32,38 ****
$(JAVAC) -classpath ../../../../ ChaosStream.java
- CheckDeepEqual.class : CheckDeepEqual.java
- $(JAVAC) -classpath ../../../../ CheckDeepEqual.java
-
ClientConnectorData.class : ClientConnectorData.java
$(JAVAC) -classpath ../../../../ ClientConnectorData.java
--- 32,35 ----
***************
*** 56,62 ****
$(JAVAC) -classpath ../../../../ DontCacheMe.java
- Immutable.class : Immutable.java
- $(JAVAC) -classpath ../../../../ Immutable.java
-
LogonPacket.class : LogonPacket.java
$(JAVAC) -classpath ../../../../ LogonPacket.java
--- 53,56 ----
***************
*** 95,102 ****
$(JAVAC) -classpath ../../../../ UpdateStuffPacket.java
DummyPacket.class : DummyPacket.java
$(JAVAC) -classpath ../../../../ DummyPacket.java
! compile : ActiveConnection.class ChangeIDPacket.class ChangeOtherSidePacket.class ChaosEnumeration.class ChaosIOException.class ChaosStream.class CheckDeepEqual.class ClientConnectorData.class ConnectionClosedPacket.class ConnectionListener.class ConnectionManager.class ConnectionOpenedPacket.class ConnectorData.class DontCacheMe.class Immutable.class LogonPacket.class NoRouteToHostPacket.class NoServerSocketException.class NotConnectedException.class ParentPacket.class ParentSerializable.class ReadOnly.class ReceiveIPsPacket.class Route.class SendIPsPacket.class TerminatePacket.class UpdateStuffPacket.class DummyPacket.class $(SUBDIRS)
chat : chat/Makefile
--- 89,102 ----
$(JAVAC) -classpath ../../../../ UpdateStuffPacket.java
+ Immutable.class : Immutable.java
+ $(JAVAC) -classpath ../../../../ Immutable.java
+
+ CheckDeepEqual.class : CheckDeepEqual.java
+ $(JAVAC) -classpath ../../../../ CheckDeepEqual.java
+
DummyPacket.class : DummyPacket.java
$(JAVAC) -classpath ../../../../ DummyPacket.java
! compile : ActiveConnection.class ChangeIDPacket.class ChangeOtherSidePacket.class ChaosEnumeration.class ChaosIOException.class ChaosStream.class ClientConnectorData.class ConnectionClosedPacket.class ConnectionListener.class ConnectionManager.class ConnectionOpenedPacket.class ConnectorData.class DontCacheMe.class LogonPacket.class NoRouteToHostPacket.class NoServerSocketException.class NotConnectedException.class ParentPacket.class ParentSerializable.class ReadOnly.class ReceiveIPsPacket.class Route.class SendIPsPacket.class TerminatePacket.class UpdateStuffPacket.class Immutable.class CheckDeepEqual.class DummyPacket.class $(SUBDIRS)
chat : chat/Makefile
|
|
From: Michael S. <lic...@us...> - 2002-06-21 05:58:50
|
Update of /cvsroot/chaosrts/net/sourceforge/chaosrts/client/chat In directory usw-pr-cvs1:/tmp/cvs-serv2680/sourceforge/chaosrts/client/chat Modified Files: JAVA.SOURCES Makefile Log Message: Added support for unit movement to simple client. Fixed some minor bugs and found some others. Index: JAVA.SOURCES =================================================================== RCS file: /cvsroot/chaosrts/net/sourceforge/chaosrts/client/chat/JAVA.SOURCES,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** JAVA.SOURCES 26 Apr 2002 20:51:44 -0000 1.10 --- JAVA.SOURCES 21 Jun 2002 05:58:46 -0000 1.11 *************** *** 1,3 **** - BlockListDialog.java ChatClient.java ChatClientConfigPanel.java --- 1,3 ---- ChatClient.java ChatClientConfigPanel.java + BlockListDialog.java Index: Makefile =================================================================== RCS file: /cvsroot/chaosrts/net/sourceforge/chaosrts/client/chat/Makefile,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** Makefile 26 Apr 2002 20:51:44 -0000 1.48 --- Makefile 21 Jun 2002 05:58:46 -0000 1.49 *************** *** 4,9 **** include ../../../../Makefile.defs ! CLASSES = BlockListDialog.class ChatClient.class ChatClientConfigPanel.class ! SOURCES = BlockListDialog.java ChatClient.java ChatClientConfigPanel.java SUBDIRS = MAKEGENCONF=../../../../Makefile.defs --- 4,9 ---- include ../../../../Makefile.defs ! CLASSES = ChatClient.class ChatClientConfigPanel.class BlockListDialog.class ! SOURCES = ChatClient.java ChatClientConfigPanel.java BlockListDialog.java SUBDIRS = MAKEGENCONF=../../../../Makefile.defs *************** *** 14,20 **** all : fullcompile - BlockListDialog.class : BlockListDialog.java - $(JAVAC) -classpath ../../../../../ BlockListDialog.java - ChatClient.class : ChatClient.java $(JAVAC) -classpath ../../../../../ ChatClient.java --- 14,17 ---- *************** *** 23,27 **** $(JAVAC) -classpath ../../../../../ ChatClientConfigPanel.java ! compile : BlockListDialog.class ChatClient.class ChatClientConfigPanel.class $(SUBDIRS) clean : --- 20,27 ---- $(JAVAC) -classpath ../../../../../ ChatClientConfigPanel.java ! BlockListDialog.class : BlockListDialog.java ! $(JAVAC) -classpath ../../../../../ BlockListDialog.java ! ! compile : ChatClient.class ChatClientConfigPanel.class BlockListDialog.class $(SUBDIRS) clean : |
|
From: Michael S. <lic...@us...> - 2002-06-21 05:58:50
|
Update of /cvsroot/chaosrts/net/sourceforge/chaosrts/client/galaxy/engine In directory usw-pr-cvs1:/tmp/cvs-serv2680/sourceforge/chaosrts/client/galaxy/engine Modified Files: Makefile Log Message: Added support for unit movement to simple client. Fixed some minor bugs and found some others. Index: Makefile =================================================================== RCS file: /cvsroot/chaosrts/net/sourceforge/chaosrts/client/galaxy/engine/Makefile,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Makefile 22 Apr 2002 22:27:49 -0000 1.5 --- Makefile 21 Jun 2002 05:58:46 -0000 1.6 *************** *** 4,9 **** include ../../../../../Makefile.defs ! CLASSES = Engine3D.class EngineTest.class FPSBehavior.class UnitMover.class UnitMoverThread.class ViewBehavior.class EnginePlugin.class StructureModel.class ! SOURCES = Engine3D.java EngineTest.java FPSBehavior.java UnitMover.java UnitMoverThread.java ViewBehavior.java EnginePlugin.java StructureModel.java SUBDIRS = MAKEGENCONF=../../../../../Makefile.defs --- 4,9 ---- include ../../../../../Makefile.defs ! CLASSES = Engine3D.class EngineTest.class FPSBehavior.class UnitMover.class UnitMoverThread.class ViewBehavior.class EnginePlugin.class StructureModel.class TerrainTextureManager.class ! SOURCES = Engine3D.java EngineTest.java FPSBehavior.java UnitMover.java UnitMoverThread.java ViewBehavior.java EnginePlugin.java StructureModel.java TerrainTextureManager.java SUBDIRS = MAKEGENCONF=../../../../../Makefile.defs *************** *** 38,42 **** $(JAVAC) -classpath ../../../../../../ StructureModel.java ! compile : Engine3D.class EngineTest.class FPSBehavior.class UnitMover.class UnitMoverThread.class ViewBehavior.class EnginePlugin.class StructureModel.class $(SUBDIRS) clean : --- 38,45 ---- $(JAVAC) -classpath ../../../../../../ StructureModel.java ! TerrainTextureManager.class : TerrainTextureManager.java ! $(JAVAC) -classpath ../../../../../../ TerrainTextureManager.java ! ! compile : Engine3D.class EngineTest.class FPSBehavior.class UnitMover.class UnitMoverThread.class ViewBehavior.class EnginePlugin.class StructureModel.class TerrainTextureManager.class $(SUBDIRS) clean : |
|
From: Michael S. <lic...@us...> - 2002-06-21 05:58:50
|
Update of /cvsroot/chaosrts/net/sourceforge/chaosrts
In directory usw-pr-cvs1:/tmp/cvs-serv2680/sourceforge/chaosrts
Modified Files:
Debug.java
Log Message:
Added support for unit movement to simple client. Fixed some minor bugs and found some others.
Index: Debug.java
===================================================================
RCS file: /cvsroot/chaosrts/net/sourceforge/chaosrts/Debug.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** Debug.java 2 Apr 2002 00:52:04 -0000 1.13
--- Debug.java 21 Jun 2002 05:58:46 -0000 1.14
***************
*** 70,74 ****
*@see Debug#setDebug
*/
! private static boolean toDebug=false;
/**Set toDebug.
*
--- 70,74 ----
*@see Debug#setDebug
*/
! private static boolean toDebug=true;
/**Set toDebug.
*
|
|
From: Michael S. <lic...@us...> - 2002-06-21 05:58:50
|
Update of /cvsroot/chaosrts/net/sourceforge/chaosrts/common
In directory usw-pr-cvs1:/tmp/cvs-serv2680/sourceforge/chaosrts/common
Modified Files:
ChaosTreeItem.java JAVA.SOURCES Makefile
MoveableGalaxyObject.java Planet.java Settler.java Squad.java
Unit.java
Log Message:
Added support for unit movement to simple client. Fixed some minor bugs and found some others.
Index: ChaosTreeItem.java
===================================================================
RCS file: /cvsroot/chaosrts/net/sourceforge/chaosrts/common/ChaosTreeItem.java,v
retrieving revision 1.30
retrieving revision 1.31
diff -C2 -d -r1.30 -r1.31
*** ChaosTreeItem.java 27 May 2002 09:29:04 -0000 1.30
--- ChaosTreeItem.java 21 Jun 2002 05:58:47 -0000 1.31
***************
*** 105,109 ****
java.awt.Toolkit t=java.awt.Toolkit.getDefaultToolkit();
java.net.URL imageURL=getClass().getResource("data/images/"+image);
! loadedImage=t.createImage(imageURL);
return loadedImage;
--- 105,110 ----
java.awt.Toolkit t=java.awt.Toolkit.getDefaultToolkit();
java.net.URL imageURL=getClass().getResource("data/images/"+image);
! if(imageURL!=null) //How dangerous will it be to return a null image? Maybe I should create a default image...
! loadedImage=t.createImage(imageURL);
return loadedImage;
Index: JAVA.SOURCES
===================================================================
RCS file: /cvsroot/chaosrts/net/sourceforge/chaosrts/common/JAVA.SOURCES,v
retrieving revision 1.36
retrieving revision 1.37
diff -C2 -d -r1.36 -r1.37
*** JAVA.SOURCES 26 Apr 2002 20:51:44 -0000 1.36
--- JAVA.SOURCES 21 Jun 2002 05:58:47 -0000 1.37
***************
*** 18,23 ****
DoNothing.java
Engine.java
- Federation.java
- FederationPacket.java
GalaxyLocation.java
GalaxyObject.java
--- 18,21 ----
***************
*** 52,53 ****
--- 50,53 ----
UnitDesign.java
Weapon.java
+ Federation.java
+ FederationPacket.java
Index: Makefile
===================================================================
RCS file: /cvsroot/chaosrts/net/sourceforge/chaosrts/common/Makefile,v
retrieving revision 1.66
retrieving revision 1.67
diff -C2 -d -r1.66 -r1.67
*** Makefile 26 Apr 2002 20:51:44 -0000 1.66
--- Makefile 21 Jun 2002 05:58:47 -0000 1.67
***************
*** 4,9 ****
include ../../../Makefile.defs
! CLASSES = Ammo.class AI.class AmmoCat.class Armor.class Bank.class BattleLocation.class BattleObject.class Benefits.class Building.class ChaosTree.class ChaosTreeItem.class ChaosTreeLoadingException.class City.class Commodity.class ControlRights.class Defaults.class DiplomacyStatus.class DoNothing.class Engine.class Federation.class FederationPacket.class GalaxyLocation.class GalaxyObject.class GameInfo.class GovernmentType.class Grid.class GroundBuilding.class GroundStructure.class InsufficientResourcesException.class LandscapeCreator.class LandscapeTest.class MoveableGalaxyObject.class PeopleUnit.class Planet.class PopPool.class ProductionQueueItem.class ProductionTemplate.class Response.class Sector.class Settler.class Shell.class Shield.class Squad.class StarSystem.class Structure.class Subject.class Technology.class Terrain.class TrainingCourse.class TrainingSegment.class Unit.class UnitDesign.class Weapon.class
! SOURCES = Ammo.java AI.java AmmoCat.java Armor.java Bank.java BattleLocation.java BattleObject.java Benefits.java Building.java ChaosTree.java ChaosTreeItem.java ChaosTreeLoadingException.java City.java Commodity.java ControlRights.java Defaults.java DiplomacyStatus.java DoNothing.java Engine.java Federation.java FederationPacket.java GalaxyLocation.java GalaxyObject.java GameInfo.java GovernmentType.java Grid.java GroundBuilding.java GroundStructure.java InsufficientResourcesException.java LandscapeCreator.java LandscapeTest.java MoveableGalaxyObject.java PeopleUnit.java Planet.java PopPool.java ProductionQueueItem.java ProductionTemplate.java Response.java Sector.java Settler.java Shell.java Shield.java Squad.java StarSystem.java Structure.java Subject.java Technology.java Terrain.java TrainingCourse.java TrainingSegment.java Unit.java UnitDesign.java Weapon.java
SUBDIRS =
MAKEGENCONF=../../../Makefile.defs
--- 4,9 ----
include ../../../Makefile.defs
! CLASSES = Ammo.class AI.class AmmoCat.class Armor.class Bank.class BattleLocation.class BattleObject.class Benefits.class Building.class ChaosTree.class ChaosTreeItem.class ChaosTreeLoadingException.class City.class Commodity.class ControlRights.class Defaults.class DiplomacyStatus.class DoNothing.class Engine.class GalaxyLocation.class GalaxyObject.class GameInfo.class GovernmentType.class Grid.class GroundBuilding.class GroundStructure.class InsufficientResourcesException.class LandscapeCreator.class LandscapeTest.class MoveableGalaxyObject.class PeopleUnit.class Planet.class PopPool.class ProductionQueueItem.class ProductionTemplate.class Response.class Sector.class Settler.class Shell.class Shield.class Squad.class StarSystem.class Structure.class Subject.class Technology.class Terrain.class TrainingCourse.class TrainingSegment.class Unit.class UnitDesign.class Weapon.class Federation.class FederationPacket.class
! SOURCES = Ammo.java AI.java AmmoCat.java Armor.java Bank.java BattleLocation.java BattleObject.java Benefits.java Building.java ChaosTree.java ChaosTreeItem.java ChaosTreeLoadingException.java City.java Commodity.java ControlRights.java Defaults.java DiplomacyStatus.java DoNothing.java Engine.java GalaxyLocation.java GalaxyObject.java GameInfo.java GovernmentType.java Grid.java GroundBuilding.java GroundStructure.java InsufficientResourcesException.java LandscapeCreator.java LandscapeTest.java MoveableGalaxyObject.java PeopleUnit.java Planet.java PopPool.java ProductionQueueItem.java ProductionTemplate.java Response.java Sector.java Settler.java Shell.java Shield.java Squad.java StarSystem.java Structure.java Subject.java Technology.java Terrain.java TrainingCourse.java TrainingSegment.java Unit.java UnitDesign.java Weapon.java Federation.java FederationPacket.java
SUBDIRS =
MAKEGENCONF=../../../Makefile.defs
***************
*** 71,80 ****
$(JAVAC) -classpath ../../../../ Engine.java
- Federation.class : Federation.java
- $(JAVAC) -classpath ../../../../ Federation.java
-
- FederationPacket.class : FederationPacket.java
- $(JAVAC) -classpath ../../../../ FederationPacket.java
-
GalaxyLocation.class : GalaxyLocation.java
$(JAVAC) -classpath ../../../../ GalaxyLocation.java
--- 71,74 ----
***************
*** 173,177 ****
$(JAVAC) -classpath ../../../../ Weapon.java
! compile : Ammo.class AI.class AmmoCat.class Armor.class Bank.class BattleLocation.class BattleObject.class Benefits.class Building.class ChaosTree.class ChaosTreeItem.class ChaosTreeLoadingException.class City.class Commodity.class ControlRights.class Defaults.class DiplomacyStatus.class DoNothing.class Engine.class Federation.class FederationPacket.class GalaxyLocation.class GalaxyObject.class GameInfo.class GovernmentType.class Grid.class GroundBuilding.class GroundStructure.class InsufficientResourcesException.class LandscapeCreator.class LandscapeTest.class MoveableGalaxyObject.class PeopleUnit.class Planet.class PopPool.class ProductionQueueItem.class ProductionTemplate.class Response.class Sector.class Settler.class Shell.class Shield.class Squad.class StarSystem.class Structure.class Subject.class Technology.class Terrain.class TrainingCourse.class TrainingSegment.class Unit.class UnitDesign.class Weapon.class $(SUBDIRS)
clean :
--- 167,177 ----
$(JAVAC) -classpath ../../../../ Weapon.java
! Federation.class : Federation.java
! $(JAVAC) -classpath ../../../../ Federation.java
!
! FederationPacket.class : FederationPacket.java
! $(JAVAC) -classpath ../../../../ FederationPacket.java
!
! compile : Ammo.class AI.class AmmoCat.class Armor.class Bank.class BattleLocation.class BattleObject.class Benefits.class Building.class ChaosTree.class ChaosTreeItem.class ChaosTreeLoadingException.class City.class Commodity.class ControlRights.class Defaults.class DiplomacyStatus.class DoNothing.class Engine.class GalaxyLocation.class GalaxyObject.class GameInfo.class GovernmentType.class Grid.class GroundBuilding.class GroundStructure.class InsufficientResourcesException.class LandscapeCreator.class LandscapeTest.class MoveableGalaxyObject.class PeopleUnit.class Planet.class PopPool.class ProductionQueueItem.class ProductionTemplate.class Response.class Sector.class Settler.class Shell.class Shield.class Squad.class StarSystem.class Structure.class Subject.class Technology.class Terrain.class TrainingCourse.class TrainingSegment.class Unit.class UnitDesign.class Weapon.class Federation.class FederationPacket.class $(SUBDIRS)
clean :
Index: MoveableGalaxyObject.java
===================================================================
RCS file: /cvsroot/chaosrts/net/sourceforge/chaosrts/common/MoveableGalaxyObject.java,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -d -r1.24 -r1.25
*** MoveableGalaxyObject.java 26 Apr 2002 07:59:34 -0000 1.24
--- MoveableGalaxyObject.java 21 Jun 2002 05:58:47 -0000 1.25
***************
*** 282,287 ****
b=setDest((Sector)dest);
path.trimToSize();
! if(!b)
path=tmp;
else {
setRemCycles();
--- 282,289 ----
b=setDest((Sector)dest);
path.trimToSize();
! if(!b) {
! System.err.println("Couldn't get a path to the given destination");
path=tmp;
+ }
else {
setRemCycles();
***************
*** 359,362 ****
--- 361,366 ----
*/
abstract public void setStatus(boolean hasDest);
+ /**What to do when I receive an AssignMoveablePacket.*/
+ abstract public void getAssignMoveablePacket(net.sourceforge.chaosrts.protocol.galaxy.AssignMoveablePacket p);
/**Completely irradicate this from memory.
*
Index: Planet.java
===================================================================
RCS file: /cvsroot/chaosrts/net/sourceforge/chaosrts/common/Planet.java,v
retrieving revision 1.32
retrieving revision 1.33
diff -C2 -d -r1.32 -r1.33
*** Planet.java 22 Apr 2002 22:27:50 -0000 1.32
--- Planet.java 21 Jun 2002 05:58:47 -0000 1.33
***************
*** 32,36 ****
*@since 0.0.0pre2
*/
! public class Planet extends ChaosObject implements Immutable {
public Planet() {} //Added so that Class.newInstance can be used
/**Constructor.
--- 32,39 ----
*@since 0.0.0pre2
*/
! public class Planet extends ChaosObject implements Immutable {
! /**The next {@link #planetID}.*/
! private static int nextPlanetID=0;
!
public Planet() {} //Added so that Class.newInstance can be used
/**Constructor.
***************
*** 42,45 ****
--- 45,49 ----
public Planet(StarSystem thesystem) {
theSystem=thesystem;
+ planetID=nextPlanetID++;
if(theSystem!=null) {
GameInfo gi=theSystem.theSector.theServer.theInfo;
***************
*** 58,64 ****
height++;
}
!
!
!
LandscapeCreator.createTerrain(this);
--- 62,66 ----
height++;
}
!
LandscapeCreator.createTerrain(this);
***************
*** 72,75 ****
--- 74,82 ----
*/
public StarSystem theSystem;
+ /**The ID of this planet.*/
+ private int planetID;
+ public int hashCode() {
+ return planetID;
+ }
/**2 dimensional array representing the map.
*
***************
*** 143,146 ****
--- 150,154 ----
out.putInt(width);
out.writeObject(theSystem);
+ out.putInt(planetID);
}
public void readObject(ChaosStream in) throws java.io.IOException {
***************
*** 150,153 ****
--- 158,162 ----
width=in.getInt();
theSystem=(StarSystem)in.readObject();
+ planetID=in.getInt();
}
public boolean equals(Object o) {
***************
*** 156,163 ****
return false;
Planet c=(Planet)o;
! return (height==c.height&&
! width==c.width&&
! theSystem==c.theSystem&&
! super.equals(o));
}
}
--- 165,169 ----
return false;
Planet c=(Planet)o;
! return planetID==c.planetID;
}
}
Index: Settler.java
===================================================================
RCS file: /cvsroot/chaosrts/net/sourceforge/chaosrts/common/Settler.java,v
retrieving revision 1.36
retrieving revision 1.37
diff -C2 -d -r1.36 -r1.37
*** Settler.java 26 Apr 2002 07:59:34 -0000 1.36
--- Settler.java 21 Jun 2002 05:58:47 -0000 1.37
***************
*** 101,104 ****
--- 101,109 ----
return 1;
}
+ public void getAssignMoveablePacket(AssignMoveablePacket p) {
+ cityName=p.cityName;
+ groundBuilding=p.theBuilding;
+ cityGrids=p.cityGrids;
+ }
public void move() {
if(dest!=null && status==STATUS_MOVING) {
***************
*** 185,189 ****
}
public void scoutLand(Vector grids,Vector sectors) {
! grids.add(theLoc);
}
public short[] getSpeed() {
--- 190,205 ----
}
public void scoutLand(Vector grids,Vector sectors) {
! //Scout out my grid and all grids surrounding it
! int x=Math.max(0,theLoc.X()-1);
! int y=Math.max(0,theLoc.Y()-1);
!
! Planet p=((Grid)theLoc).thePlanet;
!
! for(int i=0;x<p.width && i<3;i++,x++) {
! for(int j=0;y<p.height && j<3;j++,y++) {
! grids.add(p.map[x][y]);
! }
! y=Math.max(0,theLoc.Y()-1); //Reset y
! }
}
public short[] getSpeed() {
Index: Squad.java
===================================================================
RCS file: /cvsroot/chaosrts/net/sourceforge/chaosrts/common/Squad.java,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -d -r1.26 -r1.27
*** Squad.java 26 Apr 2002 07:59:34 -0000 1.26
--- Squad.java 21 Jun 2002 05:58:47 -0000 1.27
***************
*** 76,79 ****
--- 76,80 ----
*/
public int fortCycles=0;
+ public void getAssignMoveablePacket(AssignMoveablePacket p) {}
/**Let one cycle pass. Do whatever status tells us to.
*
Index: Unit.java
===================================================================
RCS file: /cvsroot/chaosrts/net/sourceforge/chaosrts/common/Unit.java,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -d -r1.25 -r1.26
*** Unit.java 15 Apr 2002 06:33:40 -0000 1.25
--- Unit.java 21 Jun 2002 05:58:47 -0000 1.26
***************
*** 115,118 ****
--- 115,123 ----
}
}
+ /**Returns the name of my UnitDesign.*/
+ public String toString() {
+ return theDesign.theName;
+ }
+
//Battle stuff
/**My target: user-assigned.
|
|
From: Michael S. <lic...@us...> - 2002-06-21 05:58:50
|
Update of /cvsroot/chaosrts/net/sourceforge/chaosrts/client/galaxy In directory usw-pr-cvs1:/tmp/cvs-serv2680/sourceforge/chaosrts/client/galaxy Modified Files: JAVA.SOURCES Makefile Log Message: Added support for unit movement to simple client. Fixed some minor bugs and found some others. Index: JAVA.SOURCES =================================================================== RCS file: /cvsroot/chaosrts/net/sourceforge/chaosrts/client/galaxy/JAVA.SOURCES,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** JAVA.SOURCES 26 Apr 2002 20:51:44 -0000 1.21 --- JAVA.SOURCES 21 Jun 2002 05:58:46 -0000 1.22 *************** *** 1,4 **** - AdvancedClientPlugin.java - ClientPlugin.java GalaxyClient.java GalaxyClientConfigPanel.java --- 1,2 ---- *************** *** 13,14 **** --- 11,14 ---- UnitDesigner.java WaitPanel.java + AdvancedClientPlugin.java + ClientPlugin.java Index: Makefile =================================================================== RCS file: /cvsroot/chaosrts/net/sourceforge/chaosrts/client/galaxy/Makefile,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** Makefile 26 Apr 2002 20:51:44 -0000 1.49 --- Makefile 21 Jun 2002 05:58:46 -0000 1.50 *************** *** 4,9 **** include ../../../../Makefile.defs ! CLASSES = AdvancedClientPlugin.class ClientPlugin.class GalaxyClient.class GalaxyClientConfigPanel.class GameChooser.class NewCivDialog.class OverviewMap.class OverviewMapTest.class SelectionViewer.class SoundEngine.class SquadBuilder.class TrainingBuilder.class UnitDesigner.class WaitPanel.class ! SOURCES = AdvancedClientPlugin.java ClientPlugin.java GalaxyClient.java GalaxyClientConfigPanel.java GameChooser.java NewCivDialog.java OverviewMap.java OverviewMapTest.java SelectionViewer.java SoundEngine.java SquadBuilder.java TrainingBuilder.java UnitDesigner.java WaitPanel.java SUBDIRS = engine MAKEGENCONF=../../../../Makefile.defs --- 4,9 ---- include ../../../../Makefile.defs ! CLASSES = GalaxyClient.class GalaxyClientConfigPanel.class GameChooser.class NewCivDialog.class OverviewMap.class OverviewMapTest.class SelectionViewer.class SoundEngine.class SquadBuilder.class TrainingBuilder.class UnitDesigner.class WaitPanel.class AdvancedClientPlugin.class ClientPlugin.class ! SOURCES = GalaxyClient.java GalaxyClientConfigPanel.java GameChooser.java NewCivDialog.java OverviewMap.java OverviewMapTest.java SelectionViewer.java SoundEngine.java SquadBuilder.java TrainingBuilder.java UnitDesigner.java WaitPanel.java AdvancedClientPlugin.java ClientPlugin.java SUBDIRS = engine MAKEGENCONF=../../../../Makefile.defs *************** *** 14,23 **** all : fullcompile - AdvancedClientPlugin.class : AdvancedClientPlugin.java - $(JAVAC) -classpath ../../../../../ AdvancedClientPlugin.java - - ClientPlugin.class : ClientPlugin.java - $(JAVAC) -classpath ../../../../../ ClientPlugin.java - GalaxyClient.class : GalaxyClient.java $(JAVAC) -classpath ../../../../../ GalaxyClient.java --- 14,17 ---- *************** *** 56,60 **** $(JAVAC) -classpath ../../../../../ WaitPanel.java ! compile : AdvancedClientPlugin.class ClientPlugin.class GalaxyClient.class GalaxyClientConfigPanel.class GameChooser.class NewCivDialog.class OverviewMap.class OverviewMapTest.class SelectionViewer.class SoundEngine.class SquadBuilder.class TrainingBuilder.class UnitDesigner.class WaitPanel.class $(SUBDIRS) engine : engine/Makefile --- 50,60 ---- $(JAVAC) -classpath ../../../../../ WaitPanel.java ! AdvancedClientPlugin.class : AdvancedClientPlugin.java ! $(JAVAC) -classpath ../../../../../ AdvancedClientPlugin.java ! ! ClientPlugin.class : ClientPlugin.java ! $(JAVAC) -classpath ../../../../../ ClientPlugin.java ! ! compile : GalaxyClient.class GalaxyClientConfigPanel.class GameChooser.class NewCivDialog.class OverviewMap.class OverviewMapTest.class SelectionViewer.class SoundEngine.class SquadBuilder.class TrainingBuilder.class UnitDesigner.class WaitPanel.class AdvancedClientPlugin.class ClientPlugin.class $(SUBDIRS) engine : engine/Makefile |
|
From: Michael S. <lic...@us...> - 2002-06-21 05:58:49
|
Update of /cvsroot/chaosrts/net In directory usw-pr-cvs1:/tmp/cvs-serv2680 Modified Files: Makefile Log Message: Added support for unit movement to simple client. Fixed some minor bugs and found some others. Index: Makefile =================================================================== RCS file: /cvsroot/chaosrts/net/Makefile,v retrieving revision 1.103 retrieving revision 1.104 diff -C2 -d -r1.103 -r1.104 *** Makefile 26 Apr 2002 20:51:44 -0000 1.103 --- Makefile 21 Jun 2002 05:58:46 -0000 1.104 *************** *** 47,51 **** zip -9r $(NAME).zip $(ROOT_DIR) ! ALL_SOURCES= ./sourceforge/chaosrts/makegen/Makegen.java ./sourceforge/chaosrts/common/Ammo.java ./sourceforge/chaosrts/common/AI.java ./sourceforge/chaosrts/common/AmmoCat.java ./sourceforge/chaosrts/common/Armor.java ./sourceforge/chaosrts/common/Bank.java ./sourceforge/chaosrts/common/BattleLocation.java ./sourceforge/chaosrts/common/BattleObject.java ./sourceforge/chaosrts/common/Benefits.java ./sourceforge/chaosrts/common/Building.java ./sourceforge/chaosrts/common/ChaosTree.java ./sourceforge/chaosrts/common/ChaosTreeItem.java ./sourceforge/chaosrts/common/ChaosTreeLoadingException.java ./sourceforge/chaosrts/common/City.java ./sourceforge/chaosrts/common/Commodity.java ./sourceforge/chaosrts/common/ControlRights.java ./sourceforge/chaosrts/common/Defaults.java ./sourceforge/chaosrts/common/DiplomacyStatus.java ./sourceforge/chaosrts/common/DoNothing.java ./sourceforge/chaosrts/common/Engine.java ./sourceforge/chaosrts/common/Federation.java ./sourceforge/chaosrts/common/FederationPacket.java ./sourceforge/chaosrts/common/GalaxyLocation.java ./sourceforge/chaosrts/common/GalaxyObject.java ./sourceforge/chaosrts/common/GameInfo.java ./sourceforge/chaosrts/common/GovernmentType.java ./sourceforge/chaosrts/common/Grid.java ./sourceforge/chaosrts/common/GroundBuilding.java ./sourceforge/chaosrts/common/GroundStructure.java ./sourceforge/chaosrts/common/InsufficientResourcesException.java ./sourceforge/chaosrts/common/LandscapeCreator.java ./sourceforge/chaosrts/common/LandscapeTest.java ./sourceforge/chaosrts/common/MoveableGalaxyObject.java ./sourceforge/chaosrts/common/PeopleUnit.java ./sourceforge/chaosrts/common/Planet.java ./sourceforge/chaosrts/common/PopPool.java ./sourceforge/chaosrts/common/ProductionQueueItem.java ./sourceforge/chaosrts/common/ProductionTemplate.java ./sourceforge/chaosrts/common/Response.java ./sourceforge/chaosrts/common/Sector.java ./sourceforge/chaosrts/common/Settler.java ./sourceforge/chaosrts/common/Shell.java ./sourceforge/chaosrts/common/Shield.java ./sourceforge/chaosrts/common/Squad.java ./sourceforge/chaosrts/common/StarSystem.java ./sourceforge/chaosrts/common/Structure.java ./sourceforge/chaosrts/common/Subject.java ./sourceforge/chaosrts/common/Technology.java ./sourceforge/chaosrts/common/Terrain.java ./sourceforge/chaosrts/common/TrainingCourse.java ./sourceforge/chaosrts/common/TrainingSegment.java ./sourceforge/chaosrts/common/Unit.java ./sourceforge/chaosrts/common/UnitDesign.java ./sourceforge/chaosrts/common/Weapon.java ./sourceforge/chaosrts/editor/AmmoCatPanel.java ./sourceforge/chaosrts/editor/AmmoPanel.java ./sourceforge/chaosrts/editor/ArmorPanel.java ./sourceforge/chaosrts/editor/BenefitsEditor.java ./sourceforge/chaosrts/editor/BuildPanel.java ./sourceforge/chaosrts/editor/ChaosTreeProperties.java ./sourceforge/chaosrts/editor/CommodityEditor.java ./sourceforge/chaosrts/editor/DataSelector.java ./sourceforge/chaosrts/editor/EditFrame.java ./sourceforge/chaosrts/editor/EditPanel.java ./sourceforge/chaosrts/editor/Editor.java ./sourceforge/chaosrts/editor/EnginePanel.java ./sourceforge/chaosrts/editor/GovernmentTypePanel.java ./sourceforge/chaosrts/editor/GroundBuildingPanel.java ./sourceforge/chaosrts/editor/MiscPanel.java ./sourceforge/chaosrts/editor/ShellPanel.java ./sourceforge/chaosrts/editor/ShieldPanel.java ./sourceforge/chaosrts/editor/SingleSelector.java ./sourceforge/chaosrts/editor/SubjectPanel.java ./sourceforge/chaosrts/editor/TechPanel.java ./sourceforge/chaosrts/editor/TerrainPanel.java ./sourceforge/chaosrts/editor/WeaponPanel.java ./sourceforge/chaosrts/protocol/chat/GameListPacket.java ./sourceforge/chaosrts/protocol/chat/JoinChannelPacket.java ./sourceforge/chaosrts/protocol/chat/JoinedChannelPacket.java ./sourceforge/chaosrts/protocol/chat/MessagePacket.java ./sourceforge/chaosrts/protocol/chat/NickRegisteredPacket.java ./sourceforge/chaosrts/protocol/chat/PartChannelPacket.java ./sourceforge/chaosrts/protocol/chat/ReceiveMessagePacket.java ./sourceforge/chaosrts/protocol/chat/UserListPacket.java ./sourceforge/chaosrts/protocol/galaxy/AIChangedAlert.java ./sourceforge/chaosrts/protocol/galaxy/AddControllerPacket.java ./sourceforge/chaosrts/protocol/galaxy/AddPopPoolPacket.java ./sourceforge/chaosrts/protocol/galaxy/AddTrainingCoursePacket.java ./sourceforge/chaosrts/protocol/galaxy/AddUnitDesignPacket.java ./sourceforge/chaosrts/protocol/galaxy/AssignMoveablePacket.java ./sourceforge/chaosrts/protocol/galaxy/BankUpdatePacket.java ./sourceforge/chaosrts/protocol/galaxy/BuildStatusUpdatePacket.java ./sourceforge/chaosrts/protocol/galaxy/ChangeAIPacket.java ./sourceforge/chaosrts/protocol/galaxy/ChangeControlRightsPacket.java ./sourceforge/chaosrts/protocol/galaxy/ChangeDefaultsPacket.java ./sourceforge/chaosrts/protocol/galaxy/ChangeGovernmentPacket.java ./sourceforge/chaosrts/protocol/galaxy/ChangeProductionQueuePacket.java ./sourceforge/chaosrts/protocol/galaxy/ChangeResearchPacket.java ./sourceforge/chaosrts/protocol/galaxy/ChangeTaxesPacket.java ./sourceforge/chaosrts/protocol/galaxy/CityBuiltPacket.java ./sourceforge/chaosrts/protocol/galaxy/CivAlertPacket.java ./sourceforge/chaosrts/protocol/galaxy/CivControlPacket.java ./sourceforge/chaosrts/protocol/galaxy/CivUpdatePacket.java ./sourceforge/chaosrts/protocol/galaxy/CivilizationEncounteredAlert.java ./sourceforge/chaosrts/protocol/galaxy/ControllerNotAddedPacket.java ./sourceforge/chaosrts/protocol/galaxy/ControllerRequestPacket.java ./sourceforge/chaosrts/protocol/galaxy/ControllersPacket.java ./sourceforge/chaosrts/protocol/galaxy/DeadUnitUpdatePacket.java ./sourceforge/chaosrts/protocol/galaxy/DefaultsChangedAlert.java ./sourceforge/chaosrts/protocol/galaxy/DiscoveredStuffPacket.java ./sourceforge/chaosrts/protocol/galaxy/EnemySpottedAlert.java ./sourceforge/chaosrts/protocol/galaxy/FederationVotePacket.java ./sourceforge/chaosrts/protocol/galaxy/GalaxyDataPacket.java ./sourceforge/chaosrts/protocol/galaxy/GameEndedAlert.java ./sourceforge/chaosrts/protocol/galaxy/GetGalaxyDataPacket.java ./sourceforge/chaosrts/protocol/galaxy/GovernmentChangedAlert.java ./sourceforge/chaosrts/protocol/galaxy/InsufficientRightsAlert.java ./sourceforge/chaosrts/protocol/galaxy/JoinFederationPacket.java ./sourceforge/chaosrts/protocol/galaxy/JoinFederationRequestAlert.java ./sourceforge/chaosrts/protocol/galaxy/JoinGamePacket.java ./sourceforge/chaosrts/protocol/galaxy/JoinedFederationAlert.java ./sourceforge/chaosrts/protocol/galaxy/LowHousingAlert.java ./sourceforge/chaosrts/protocol/galaxy/LowMoneyAlert.java ./sourceforge/chaosrts/protocol/galaxy/LowMoraleAlert.java ./sourceforge/chaosrts/protocol/galaxy/OfferPeaceTreatyPacket.java ./sourceforge/chaosrts/protocol/galaxy/PeaceTreatyOfferedAlert.java ./sourceforge/chaosrts/protocol/galaxy/PopPoolsUpdatePacket.java ./sourceforge/chaosrts/protocol/galaxy/ProductionCompleteAlert.java ./sourceforge/chaosrts/protocol/galaxy/ProductionQueueChangedPacket.java ./sourceforge/chaosrts/protocol/galaxy/ResearchChangedAlert.java ./sourceforge/chaosrts/protocol/galaxy/ResearchCompleteAlert.java ./sourceforge/chaosrts/protocol/galaxy/ResearchUpdatePacket.java ./sourceforge/chaosrts/protocol/galaxy/RightsChangedAlert.java ./sourceforge/chaosrts/protocol/galaxy/SetViewedLocationPacket.java ./sourceforge/chaosrts/protocol/galaxy/TaxesChangedAlert.java ./sourceforge/chaosrts/protocol/galaxy/UnitDesignAddedPacket.java ./sourceforge/chaosrts/protocol/galaxy/YourCivDeadAlert.java ./sourceforge/chaosrts/protocol/galaxy/YourCivPacket.java ./sourceforge/chaosrts/protocol/galaxy/BeginGamePacket.java ./sourceforge/chaosrts/protocol/generator/Convert.java ./sourceforge/chaosrts/protocol/generator/Generator.java ./sourceforge/chaosrts/protocol/ActiveConnection.java ./sourceforge/chaosrts/protocol/ChangeIDPacket.java ./sourceforge/chaosrts/protocol/ChangeOtherSidePacket.java ./sourceforge/chaosrts/protocol/ChaosEnumeration.java ./sourceforge/chaosrts/protocol/ChaosIOException.java ./sourceforge/chaosrts/protocol/ChaosStream.java ./sourceforge/chaosrts/protocol/CheckDeepEqual.java ./sourceforge/chaosrts/protocol/ClientConnectorData.java ./sourceforge/chaosrts/protocol/ConnectionClosedPacket.java ./ sourceforge/chaosrts/protocol/ConnectionListener.java ./sourceforge/chaosrts/protocol/ConnectionManager.java ./sourceforge/chaosrts/protocol/ConnectionOpenedPacket.java ./sourceforge/chaosrts/protocol/ConnectorData.java ./sourceforge/chaosrts/protocol/DontCacheMe.java ./sourceforge/chaosrts/protocol/Immutable.java ./sourceforge/chaosrts/protocol/LogonPacket.java ./sourceforge/chaosrts/protocol/NoRouteToHostPacket.java ./sourceforge/chaosrts/protocol/NoServerSocketException.java ./sourceforge/chaosrts/protocol/NotConnectedException.java ./sourceforge/chaosrts/protocol/ParentPacket.java ./sourceforge/chaosrts/protocol/ParentSerializable.java ./sourceforge/chaosrts/protocol/ReadOnly.java ./sourceforge/chaosrts/protocol/ReceiveIPsPacket.java ./sourceforge/chaosrts/protocol/Route.java ./sourceforge/chaosrts/protocol/SendIPsPacket.java ./sourceforge/chaosrts/protocol/TerminatePacket.java ./sourceforge/chaosrts/protocol/UpdateStuffPacket.java ./sourceforge/chaosrts/protocol/DummyPacket.java ./sourceforge/chaosrts/launcher/ChaosMenuBar.java ./sourceforge/chaosrts/launcher/ChaosRTSPanel.java ./sourceforge/chaosrts/launcher/DoSkinning.java ./sourceforge/chaosrts/launcher/GlobalPropDialog.java ./sourceforge/chaosrts/launcher/Launcher.java ./sourceforge/chaosrts/launcher/OptionDialog.java ./sourceforge/chaosrts/server/protocol/AddGamePacket.java ./sourceforge/chaosrts/server/protocol/RemoveGamePacket.java ./sourceforge/chaosrts/server/protocol/CreateChannelPacket.java ./sourceforge/chaosrts/server/chat/ChatServer.java ./sourceforge/chaosrts/server/chat/ChatServerConfigPanel.java ./sourceforge/chaosrts/server/chat/ChatServerGUI.java ./sourceforge/chaosrts/server/chat/TextRouter.java ./sourceforge/chaosrts/server/galaxy/BattleEngine.java ./sourceforge/chaosrts/server/galaxy/CivData.java ./sourceforge/chaosrts/server/galaxy/Civilization.java ./sourceforge/chaosrts/server/galaxy/Controller.java ./sourceforge/chaosrts/server/galaxy/DefaultPlugin.java ./sourceforge/chaosrts/server/galaxy/EngineListener.java ./sourceforge/chaosrts/server/galaxy/GalaxyMap.java ./sourceforge/chaosrts/server/galaxy/GalaxyServer.java ./sourceforge/chaosrts/server/galaxy/GalaxyServerConfigPanel.java ./sourceforge/chaosrts/server/galaxy/GalaxyServerGUI.java ./sourceforge/chaosrts/server/galaxy/ParentEngine.java ./sourceforge/chaosrts/server/galaxy/PathFinder.java ./sourceforge/chaosrts/server/galaxy/PathTester.java ./sourceforge/chaosrts/server/galaxy/Plugin.java ./sourceforge/chaosrts/client/chat/BlockListDialog.java ./sourceforge/chaosrts/client/chat/ChatClient.java ./sourceforge/chaosrts/client/chat/ChatClientConfigPanel.java ./sourceforge/chaosrts/client/galaxy/engine/Engine3D.java ./sourceforge/chaosrts/client/galaxy/engine/EngineTest.java ./sourceforge/chaosrts/client/galaxy/engine/FPSBehavior.java ./sourceforge/chaosrts/client/galaxy/engine/UnitMover.java ./sourceforge/chaosrts/client/galaxy/engine/UnitMoverThread.java ./sourceforge/chaosrts/client/galaxy/engine/ViewBehavior.java ./sourceforge/chaosrts/client/galaxy/engine/EnginePlugin.java ./sourceforge/chaosrts/client/galaxy/engine/StructureModel.java ./sourceforge/chaosrts/client/galaxy/AdvancedClientPlugin.java ./sourceforge/chaosrts/client/galaxy/ClientPlugin.java ./sourceforge/chaosrts/client/galaxy/GalaxyClient.java ./sourceforge/chaosrts/client/galaxy/GalaxyClientConfigPanel.java ./sourceforge/chaosrts/client/galaxy/GameChooser.java ./sourceforge/chaosrts/client/galaxy/NewCivDialog.java ./sourceforge/chaosrts/client/galaxy/OverviewMap.java ./sourceforge/chaosrts/client/galaxy/OverviewMapTest.java ./sourceforge/chaosrts/client/galaxy/SelectionViewer.java ./sourceforge/chaosrts/client/galaxy/SoundEngine.java ./sourceforge/chaosrts/client/galaxy/SquadBuilder.java ./sourceforge/chaosrts/client/galaxy/TrainingBuilder.java ./sourceforge/chaosrts/client/galaxy/UnitDesigner.java ./sourceforge/chaosrts/client/galaxy/WaitPanel.java ./sourceforge/chaosrts/simpleclient/ChatClientConfigDialog.java ./sourceforge/chaosrts/simpleclient/ConfirmExitDialog.java ./sourceforge/chaosrts/simpleclient/MessageDialog.java ./sourceforge/chaosrts/simpleclient/SimpleChatClient.java ./sourceforge/chaosrts/simpleclient/GameListDialog.java ./sourceforge/chaosrts/simpleclient/GridCanvas.java ./sourceforge/chaosrts/simpleclient/JoinGameDialog.java ./sourceforge/chaosrts/simpleclient/SimpleGalaxyClient.java ./sourceforge/chaosrts/simpleclient/SimpleGrid.java ./sourceforge/chaosrts/simpleclient/SimplePlanet.java ./sourceforge/chaosrts/simpleclient/TextInputDialog.java ./sourceforge/chaosrts/simpleclient/YesNoDialog.java ./sourceforge/chaosrts/simpleclient/GridInfoPanel.java ./sourceforge/chaosrts/simpleclient/ListDialog.java ./sourceforge/chaosrts/Debug.java ./sourceforge/chaosrts/ChaosJFrame.java ./sourceforge/chaosrts/ChaosObject.java ./sourceforge/chaosrts/SetSpeedDialog.java ALL_JAVASOURCES= ././sourceforge/chaosrts/makegen/JAVA.SOURCES ././sourceforge/chaosrts/common/JAVA.SOURCES ././sourceforge/chaosrts/editor/JAVA.SOURCES ././sourceforge/chaosrts/protocol/chat/JAVA.SOURCES ././sourceforge/chaosrts/protocol/galaxy/JAVA.SOURCES ././sourceforge/chaosrts/protocol/generator/JAVA.SOURCES ././sourceforge/chaosrts/protocol/JAVA.SOURCES ././sourceforge/chaosrts/launcher/JAVA.SOURCES ././sourceforge/chaosrts/server/protocol/JAVA.SOURCES ././sourceforge/chaosrts/server/chat/JAVA.SOURCES ././sourceforge/chaosrts/server/galaxy/JAVA.SOURCES ././sourceforge/chaosrts/server/JAVA.SOURCES ././sourceforge/chaosrts/client/chat/JAVA.SOURCES ././sourceforge/chaosrts/client/galaxy/engine/JAVA.SOURCES ././sourceforge/chaosrts/client/galaxy/JAVA.SOURCES ././sourceforge/chaosrts/client/JAVA.SOURCES ././sourceforge/chaosrts/simpleclient/JAVA.SOURCES ././sourceforge/chaosrts/JAVA.SOURCES ././sourceforge/JAVA.SOURCES ././JAVA.SOURCES --- 47,51 ---- zip -9r $(NAME).zip $(ROOT_DIR) ! ALL_SOURCES= ./sourceforge/chaosrts/makegen/Makegen.java ./sourceforge/chaosrts/common/Ammo.java ./sourceforge/chaosrts/common/AI.java ./sourceforge/chaosrts/common/AmmoCat.java ./sourceforge/chaosrts/common/Armor.java ./sourceforge/chaosrts/common/Bank.java ./sourceforge/chaosrts/common/BattleLocation.java ./sourceforge/chaosrts/common/BattleObject.java ./sourceforge/chaosrts/common/Benefits.java ./sourceforge/chaosrts/common/Building.java ./sourceforge/chaosrts/common/ChaosTree.java ./sourceforge/chaosrts/common/ChaosTreeItem.java ./sourceforge/chaosrts/common/ChaosTreeLoadingException.java ./sourceforge/chaosrts/common/City.java ./sourceforge/chaosrts/common/Commodity.java ./sourceforge/chaosrts/common/ControlRights.java ./sourceforge/chaosrts/common/Defaults.java ./sourceforge/chaosrts/common/DiplomacyStatus.java ./sourceforge/chaosrts/common/DoNothing.java ./sourceforge/chaosrts/common/Engine.java ./sourceforge/chaosrts/common/GalaxyLocation.java ./sourceforge/chaosrts/common/GalaxyObject.java ./sourceforge/chaosrts/common/GameInfo.java ./sourceforge/chaosrts/common/GovernmentType.java ./sourceforge/chaosrts/common/Grid.java ./sourceforge/chaosrts/common/GroundBuilding.java ./sourceforge/chaosrts/common/GroundStructure.java ./sourceforge/chaosrts/common/InsufficientResourcesException.java ./sourceforge/chaosrts/common/LandscapeCreator.java ./sourceforge/chaosrts/common/LandscapeTest.java ./sourceforge/chaosrts/common/MoveableGalaxyObject.java ./sourceforge/chaosrts/common/PeopleUnit.java ./sourceforge/chaosrts/common/Planet.java ./sourceforge/chaosrts/common/PopPool.java ./sourceforge/chaosrts/common/ProductionQueueItem.java ./sourceforge/chaosrts/common/ProductionTemplate.java ./sourceforge/chaosrts/common/Response.java ./sourceforge/chaosrts/common/Sector.java ./sourceforge/chaosrts/common/Settler.java ./sourceforge/chaosrts/common/Shell.java ./sourceforge/chaosrts/common/Shield.java ./sourceforge/chaosrts/common/Squad.java ./sourceforge/chaosrts/common/StarSystem.java ./sourceforge/chaosrts/common/Structure.java ./sourceforge/chaosrts/common/Subject.java ./sourceforge/chaosrts/common/Technology.java ./sourceforge/chaosrts/common/Terrain.java ./sourceforge/chaosrts/common/TrainingCourse.java ./sourceforge/chaosrts/common/TrainingSegment.java ./sourceforge/chaosrts/common/Unit.java ./sourceforge/chaosrts/common/UnitDesign.java ./sourceforge/chaosrts/common/Weapon.java ./sourceforge/chaosrts/common/Federation.java ./sourceforge/chaosrts/common/FederationPacket.java ./sourceforge/chaosrts/editor/AmmoCatPanel.java ./sourceforge/chaosrts/editor/AmmoPanel.java ./sourceforge/chaosrts/editor/ArmorPanel.java ./sourceforge/chaosrts/editor/BenefitsEditor.java ./sourceforge/chaosrts/editor/BuildPanel.java ./sourceforge/chaosrts/editor/ChaosTreeProperties.java ./sourceforge/chaosrts/editor/CommodityEditor.java ./sourceforge/chaosrts/editor/DataSelector.java ./sourceforge/chaosrts/editor/EditFrame.java ./sourceforge/chaosrts/editor/EditPanel.java ./sourceforge/chaosrts/editor/Editor.java ./sourceforge/chaosrts/editor/EnginePanel.java ./sourceforge/chaosrts/editor/GovernmentTypePanel.java ./sourceforge/chaosrts/editor/GroundBuildingPanel.java ./sourceforge/chaosrts/editor/MiscPanel.java ./sourceforge/chaosrts/editor/ShellPanel.java ./sourceforge/chaosrts/editor/ShieldPanel.java ./sourceforge/chaosrts/editor/SingleSelector.java ./sourceforge/chaosrts/editor/SubjectPanel.java ./sourceforge/chaosrts/editor/TechPanel.java ./sourceforge/chaosrts/editor/TerrainPanel.java ./sourceforge/chaosrts/editor/WeaponPanel.java ./sourceforge/chaosrts/protocol/chat/GameListPacket.java ./sourceforge/chaosrts/protocol/chat/JoinChannelPacket.java ./sourceforge/chaosrts/protocol/chat/JoinedChannelPacket.java ./sourceforge/chaosrts/protocol/chat/MessagePacket.java ./sourceforge/chaosrts/protocol/chat/NickRegisteredPacket.java ./sourceforge/chaosrts/protocol/chat/PartChannelPacket.java ./sourceforge/chaosrts/protocol/chat/ReceiveMessagePacket.java ./sourceforge/chaosrts/protocol/chat/UserListPacket.java ./sourceforge/chaosrts/protocol/galaxy/AIChangedAlert.java ./sourceforge/chaosrts/protocol/galaxy/AddControllerPacket.java ./sourceforge/chaosrts/protocol/galaxy/AddPopPoolPacket.java ./sourceforge/chaosrts/protocol/galaxy/AddTrainingCoursePacket.java ./sourceforge/chaosrts/protocol/galaxy/AddUnitDesignPacket.java ./sourceforge/chaosrts/protocol/galaxy/AssignMoveablePacket.java ./sourceforge/chaosrts/protocol/galaxy/BankUpdatePacket.java ./sourceforge/chaosrts/protocol/galaxy/BuildStatusUpdatePacket.java ./sourceforge/chaosrts/protocol/galaxy/ChangeAIPacket.java ./sourceforge/chaosrts/protocol/galaxy/ChangeControlRightsPacket.java ./sourceforge/chaosrts/protocol/galaxy/ChangeDefaultsPacket.java ./sourceforge/chaosrts/protocol/galaxy/ChangeGovernmentPacket.java ./sourceforge/chaosrts/protocol/galaxy/ChangeProductionQueuePacket.java ./sourceforge/chaosrts/protocol/galaxy/ChangeResearchPacket.java ./sourceforge/chaosrts/protocol/galaxy/ChangeTaxesPacket.java ./sourceforge/chaosrts/protocol/galaxy/CityBuiltPacket.java ./sourceforge/chaosrts/protocol/galaxy/CivAlertPacket.java ./sourceforge/chaosrts/protocol/galaxy/CivControlPacket.java ./sourceforge/chaosrts/protocol/galaxy/CivUpdatePacket.java ./sourceforge/chaosrts/protocol/galaxy/CivilizationEncounteredAlert.java ./sourceforge/chaosrts/protocol/galaxy/ControllerNotAddedPacket.java ./sourceforge/chaosrts/protocol/galaxy/ControllerRequestPacket.java ./sourceforge/chaosrts/protocol/galaxy/ControllersPacket.java ./sourceforge/chaosrts/protocol/galaxy/DeadUnitUpdatePacket.java ./sourceforge/chaosrts/protocol/galaxy/DefaultsChangedAlert.java ./sourceforge/chaosrts/protocol/galaxy/DiscoveredStuffPacket.java ./sourceforge/chaosrts/protocol/galaxy/EnemySpottedAlert.java ./sourceforge/chaosrts/protocol/galaxy/GalaxyDataPacket.java ./sourceforge/chaosrts/protocol/galaxy/GameEndedAlert.java ./sourceforge/chaosrts/protocol/galaxy/GetGalaxyDataPacket.java ./sourceforge/chaosrts/protocol/galaxy/GovernmentChangedAlert.java ./sourceforge/chaosrts/protocol/galaxy/InsufficientRightsAlert.java ./sourceforge/chaosrts/protocol/galaxy/JoinGamePacket.java ./sourceforge/chaosrts/protocol/galaxy/LowHousingAlert.java ./sourceforge/chaosrts/protocol/galaxy/LowMoneyAlert.java ./sourceforge/chaosrts/protocol/galaxy/LowMoraleAlert.java ./sourceforge/chaosrts/protocol/galaxy/OfferPeaceTreatyPacket.java ./sourceforge/chaosrts/protocol/galaxy/PeaceTreatyOfferedAlert.java ./sourceforge/chaosrts/protocol/galaxy/PopPoolsUpdatePacket.java ./sourceforge/chaosrts/protocol/galaxy/ProductionCompleteAlert.java ./sourceforge/chaosrts/protocol/galaxy/ProductionQueueChangedPacket.java ./sourceforge/chaosrts/protocol/galaxy/ResearchChangedAlert.java ./sourceforge/chaosrts/protocol/galaxy/ResearchCompleteAlert.java ./sourceforge/chaosrts/protocol/galaxy/ResearchUpdatePacket.java ./sourceforge/chaosrts/protocol/galaxy/RightsChangedAlert.java ./sourceforge/chaosrts/protocol/galaxy/SetViewedLocationPacket.java ./sourceforge/chaosrts/protocol/galaxy/TaxesChangedAlert.java ./sourceforge/chaosrts/protocol/galaxy/UnitDesignAddedPacket.java ./sourceforge/chaosrts/protocol/galaxy/YourCivDeadAlert.java ./sourceforge/chaosrts/protocol/galaxy/YourCivPacket.java ./sourceforge/chaosrts/protocol/galaxy/BeginGamePacket.java ./sourceforge/chaosrts/protocol/galaxy/JoinedFederationAlert.java ./sourceforge/chaosrts/protocol/galaxy/JoinFederationPacket.java ./sourceforge/chaosrts/protocol/galaxy/FederationVotePacket.java ./sourceforge/chaosrts/protocol/galaxy/JoinFederationRequestAlert.java ./sourceforge/chaosrts/protocol/generator/Generator.java ./sourceforge/chaosrts/protocol/generator/Convert.java ./sourceforge/chaosrts/protocol/ActiveConnection.java ./sourceforge/chaosrts/protocol/ChangeIDPacket.java ./sourceforge/chaosrts/protocol/ChangeOtherSidePacket.java ./sourceforge/chaosrts/protocol/ChaosEnumeration.java ./sourceforge/chaosrts/protocol/ChaosIOException.java ./sourceforge/chaosrts/protocol/ChaosStream.java ./sourceforge/chaosrts/protocol/ClientConnectorData.java ./sourceforge/chaosrts/protocol/ConnectionClosedPacket.java ./sourceforge/chaosrts/protocol/ConnectionListener.jav a ./sourceforge/chaosrts/protocol/ConnectionManager.java ./sourceforge/chaosrts/protocol/ConnectionOpenedPacket.java ./sourceforge/chaosrts/protocol/ConnectorData.java ./sourceforge/chaosrts/protocol/DontCacheMe.java ./sourceforge/chaosrts/protocol/LogonPacket.java ./sourceforge/chaosrts/protocol/NoRouteToHostPacket.java ./sourceforge/chaosrts/protocol/NoServerSocketException.java ./sourceforge/chaosrts/protocol/NotConnectedException.java ./sourceforge/chaosrts/protocol/ParentPacket.java ./sourceforge/chaosrts/protocol/ParentSerializable.java ./sourceforge/chaosrts/protocol/ReadOnly.java ./sourceforge/chaosrts/protocol/ReceiveIPsPacket.java ./sourceforge/chaosrts/protocol/Route.java ./sourceforge/chaosrts/protocol/SendIPsPacket.java ./sourceforge/chaosrts/protocol/TerminatePacket.java ./sourceforge/chaosrts/protocol/UpdateStuffPacket.java ./sourceforge/chaosrts/protocol/Immutable.java ./sourceforge/chaosrts/protocol/CheckDeepEqual.java ./sourceforge/chaosrts/protocol/DummyPacket.java ./sourceforge/chaosrts/launcher/ChaosMenuBar.java ./sourceforge/chaosrts/launcher/ChaosRTSPanel.java ./sourceforge/chaosrts/launcher/DoSkinning.java ./sourceforge/chaosrts/launcher/GlobalPropDialog.java ./sourceforge/chaosrts/launcher/Launcher.java ./sourceforge/chaosrts/launcher/OptionDialog.java ./sourceforge/chaosrts/server/protocol/AddGamePacket.java ./sourceforge/chaosrts/server/protocol/RemoveGamePacket.java ./sourceforge/chaosrts/server/protocol/CreateChannelPacket.java ./sourceforge/chaosrts/server/chat/ChatServer.java ./sourceforge/chaosrts/server/chat/ChatServerConfigPanel.java ./sourceforge/chaosrts/server/chat/ChatServerGUI.java ./sourceforge/chaosrts/server/chat/TextRouter.java ./sourceforge/chaosrts/server/galaxy/BattleEngine.java ./sourceforge/chaosrts/server/galaxy/CivData.java ./sourceforge/chaosrts/server/galaxy/Civilization.java ./sourceforge/chaosrts/server/galaxy/Controller.java ./sourceforge/chaosrts/server/galaxy/DefaultPlugin.java ./sourceforge/chaosrts/server/galaxy/EngineListener.java ./sourceforge/chaosrts/server/galaxy/GalaxyMap.java ./sourceforge/chaosrts/server/galaxy/GalaxyServer.java ./sourceforge/chaosrts/server/galaxy/GalaxyServerConfigPanel.java ./sourceforge/chaosrts/server/galaxy/GalaxyServerGUI.java ./sourceforge/chaosrts/server/galaxy/ParentEngine.java ./sourceforge/chaosrts/server/galaxy/PathFinder.java ./sourceforge/chaosrts/server/galaxy/PathTester.java ./sourceforge/chaosrts/server/galaxy/Plugin.java ./sourceforge/chaosrts/client/chat/ChatClient.java ./sourceforge/chaosrts/client/chat/ChatClientConfigPanel.java ./sourceforge/chaosrts/client/chat/BlockListDialog.java ./sourceforge/chaosrts/client/galaxy/engine/Engine3D.java ./sourceforge/chaosrts/client/galaxy/engine/EngineTest.java ./sourceforge/chaosrts/client/galaxy/engine/FPSBehavior.java ./sourceforge/chaosrts/client/galaxy/engine/UnitMover.java ./sourceforge/chaosrts/client/galaxy/engine/UnitMoverThread.java ./sourceforge/chaosrts/client/galaxy/engine/ViewBehavior.java ./sourceforge/chaosrts/client/galaxy/engine/EnginePlugin.java ./sourceforge/chaosrts/client/galaxy/engine/StructureModel.java ./sourceforge/chaosrts/client/galaxy/engine/TerrainTextureManager.java ./sourceforge/chaosrts/client/galaxy/GalaxyClient.java ./sourceforge/chaosrts/client/galaxy/GalaxyClientConfigPanel.java ./sourceforge/chaosrts/client/galaxy/GameChooser.java ./sourceforge/chaosrts/client/galaxy/NewCivDialog.java ./sourceforge/chaosrts/client/galaxy/OverviewMap.java ./sourceforge/chaosrts/client/galaxy/OverviewMapTest.java ./sourceforge/chaosrts/client/galaxy/SelectionViewer.java ./sourceforge/chaosrts/client/galaxy/SoundEngine.java ./sourceforge/chaosrts/client/galaxy/SquadBuilder.java ./sourceforge/chaosrts/client/galaxy/TrainingBuilder.java ./sourceforge/chaosrts/client/galaxy/UnitDesigner.java ./sourceforge/chaosrts/client/galaxy/WaitPanel.java ./sourceforge/chaosrts/client/galaxy/AdvancedClientPlugin.java ./sourceforge/chaosrts/client/galaxy/ClientPlugin.java ./sourceforge/chaosrts/simpleclient/SimpleChatClient.java ./sourceforge/chaosrts/simpleclient/ChatClientConfigDialog.java ./sourceforge/chaosrts/simpleclient/ConfirmExitDialog.java ./sourceforge/chaosrts/simpleclient/MessageDialog.java ./sourceforge/chaosrts/simpleclient/GameListDialog.java ./sourceforge/chaosrts/simpleclient/SimpleGalaxyClient.java ./sourceforge/chaosrts/simpleclient/JoinGameDialog.java ./sourceforge/chaosrts/simpleclient/TextInputDialog.java ./sourceforge/chaosrts/simpleclient/YesNoDialog.java ./sourceforge/chaosrts/simpleclient/GridCanvas.java ./sourceforge/chaosrts/simpleclient/SimplePlanet.java ./sourceforge/chaosrts/simpleclient/SimpleGrid.java ./sourceforge/chaosrts/simpleclient/GridInfoPanel.java ./sourceforge/chaosrts/simpleclient/ListDialog.java ./sourceforge/chaosrts/simpleclient/NewCivDialog.java ./sourceforge/chaosrts/simpleclient/SquadSelectorDialog.java ./sourceforge/chaosrts/Debug.java ./sourceforge/chaosrts/ChaosJFrame.java ./sourceforge/chaosrts/ChaosObject.java ./sourceforge/chaosrts/SetSpeedDialog.java ALL_JAVASOURCES= ././sourceforge/chaosrts/makegen/JAVA.SOURCES ././sourceforge/chaosrts/common/JAVA.SOURCES ././sourceforge/chaosrts/editor/JAVA.SOURCES ././sourceforge/chaosrts/protocol/chat/JAVA.SOURCES ././sourceforge/chaosrts/protocol/galaxy/JAVA.SOURCES ././sourceforge/chaosrts/protocol/generator/JAVA.SOURCES ././sourceforge/chaosrts/protocol/JAVA.SOURCES ././sourceforge/chaosrts/launcher/JAVA.SOURCES ././sourceforge/chaosrts/server/protocol/JAVA.SOURCES ././sourceforge/chaosrts/server/chat/JAVA.SOURCES ././sourceforge/chaosrts/server/galaxy/JAVA.SOURCES ././sourceforge/chaosrts/server/JAVA.SOURCES ././sourceforge/chaosrts/client/chat/JAVA.SOURCES ././sourceforge/chaosrts/client/galaxy/engine/JAVA.SOURCES ././sourceforge/chaosrts/client/galaxy/JAVA.SOURCES ././sourceforge/chaosrts/client/JAVA.SOURCES ././sourceforge/chaosrts/simpleclient/JAVA.SOURCES ././sourceforge/chaosrts/JAVA.SOURCES ././sourceforge/JAVA.SOURCES ././JAVA.SOURCES |
|
From: Michael S. <lic...@us...> - 2002-06-20 19:29:51
|
Update of /cvsroot/chaosrts/webpage/htdocs/content In directory usw-pr-cvs1:/tmp/cvs-serv12221 Modified Files: _home_welcome.html Log Message: Added beta tester message on main page Index: _home_welcome.html =================================================================== RCS file: /cvsroot/chaosrts/webpage/htdocs/content/_home_welcome.html,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** _home_welcome.html 21 Apr 2002 05:21:44 -0000 1.3 --- _home_welcome.html 20 Jun 2002 19:29:46 -0000 1.4 *************** *** 1,3 **** - <center><p><h2><a href="?page=help.html">CALLING ALL GAMERS! Beta testers needed desperately!</a></h2></p></center> <P>Welcome to the home page for Chaotic Domain, an open source game <a href="http://www.sourceforge.net/projects/chaosrts">project</a> being developed at <a --- 1,2 ---- |