[Jais-checkins] jaisteam/src/jais/world WorldModel.java,1.58,1.59 WorldDataAccessInterface.java,1.10
Status: Beta
Brought to you by:
maestrodd
|
From: <mae...@us...> - 2002-07-14 22:56:43
|
Update of /cvsroot/jais/jaisteam/src/jais/world
In directory usw-pr-cvs1:/tmp/cvs-serv30379/world
Modified Files:
WorldModel.java WorldDataAccessInterface.java
Log Message:
viewmodes added & more
checkgoalkick new progged by bombenleger
...
many bugs....
Index: WorldModel.java
===================================================================
RCS file: /cvsroot/jais/jaisteam/src/jais/world/WorldModel.java,v
retrieving revision 1.58
retrieving revision 1.59
diff -C2 -d -r1.58 -r1.59
*** WorldModel.java 14 Jul 2002 14:01:23 -0000 1.58
--- WorldModel.java 14 Jul 2002 22:56:40 -0000 1.59
***************
*** 51,54 ****
--- 51,57 ----
private double m_absBodyDir;
+ private boolean m_aPlayerIsBehind;
+ private boolean m_ballIsBehind;
+
/**
* Constructor initializes the member variables.
***************
*** 150,163 ****
public SenseBodyInfo getSenseBodyInfo()
{
! try
! {
! return(SenseBodyInfo)m_senseBodyInfos.getLast();
! }
! catch (Exception ex)
! {
! while(m_senseBodyInfos.isEmpty())
! { } //wait until we have an object
! return(SenseBodyInfo)m_senseBodyInfos.getLast();
! }
}
--- 153,166 ----
public SenseBodyInfo getSenseBodyInfo()
{
! try
! {
! return(SenseBodyInfo)m_senseBodyInfos.getLast();
! }
! catch (Exception ex)
! {
! while(m_senseBodyInfos.isEmpty())
! { } //wait until we have an object
! return(SenseBodyInfo)m_senseBodyInfos.getLast();
! }
}
***************
*** 230,234 ****
--- 233,245 ----
}
+ public boolean isPlayerBehind()
+ {
+ return m_aPlayerIsBehind;
+ }
+ public boolean isBallBehind()
+ {
+ return m_ballIsBehind;
+ }
/****************************************************************************************/
***************
*** 262,267 ****
public synchronized void updateVisualInfo(VisualEvent f_visualEvent)
{
- jais.utils.Timer l_timer=new jais.utils.Timer();
- l_timer.Start();
logger.info("updating my Visual Info and calculating absolute positions now");
ArrayList l_visualInfos=f_visualEvent.getObjects();
--- 273,276 ----
***************
*** 272,275 ****
--- 281,287 ----
m_currentlySeenLines=new LinkedList();
m_ball.setVisible(false);
+ m_ballIsBehind=false;
+ m_aPlayerIsBehind=false;
+
//store the objects in this visual event in the correct list
for(ListIterator it=l_visualInfos.listIterator();it.hasNext();)
***************
*** 285,288 ****
--- 297,302 ----
if (!l_objectInfo.isBehind())
m_currentlySeenPlayers.addLast(l_objectInfo);
+ else
+ m_aPlayerIsBehind=true;
}
else if (l_objectInfo instanceof BallInfo) //if we see the ball, store it
***************
*** 294,297 ****
--- 308,313 ----
m_ball.setVisible(true);
}
+ else
+ m_ballIsBehind=true;
}
else if (l_objectInfo instanceof GoalInfo) // store the goal(s)
***************
*** 311,315 ****
updateAbsolutePositions();
updatePlayerLists();
- logger.info("updating visual info lasted: "+l_timer.GetTime());
}
--- 327,330 ----
Index: WorldDataAccessInterface.java
===================================================================
RCS file: /cvsroot/jais/jaisteam/src/jais/world/WorldDataAccessInterface.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** WorldDataAccessInterface.java 14 Jul 2002 14:01:23 -0000 1.10
--- WorldDataAccessInterface.java 14 Jul 2002 22:56:40 -0000 1.11
***************
*** 174,176 ****
--- 174,188 ----
*/
public LinkedList getCurrentylSeenGoals();
+
+ /**
+ * This method checks if any player is behind me (as then it is not in the lists)
+ * @return true if a player is behind me, otherwise false
+ */
+ public boolean isPlayerBehind();
+
+ /**
+ * This method checks the ball is behind me (as then it is not visible)
+ * @return true if ball is behind me, otherwise false
+ */
+ public boolean isBallBehind();
}
|