org.smtose.shadowedhorizons.world
Class HexLocale

java.lang.Object
  extended byorg.smtose.shadowedhorizons.world.HexLocale
All Implemented Interfaces:
Locale

public class HexLocale
extends java.lang.Object
implements Locale

Implements a hexagonal grid layout for locales.

The HexLocale class is copyright© 2005 smtose.org (www.smtose.org)

Author:
Gregory Brown, smtose.org

Constructor Summary
HexLocale()
           
 
Method Summary
 MetaObject[] allObjects()
           
 MetaObject get(int objectID)
           
 MetaObject get(Position pos)
          Gets the object at a given position
 MetaObject get(java.lang.String name)
          Gets an object by a given name
 Position getNamedPoint(java.lang.String key)
           
 boolean isEmpty(Position pos)
           
 boolean isInLocale(MetaObject meta)
           
 void move(MetaObject meta, Position newPos)
           
 void move(Position oldPos, Position newPos)
           
 MetaObject peek(Position pos)
           
 void put(MetaObject meta)
          Puts an object into the environment at the first open position.
 void put(MetaObject meta, Position pos)
          Puts an object into the environment at a given position.
 void remove(int objectID)
           
 void remove(MetaObject meta)
           
 void remove(java.lang.String name)
           
 void setNamedPoint(java.lang.String key, Position pos)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.smtose.shadowedhorizons.world.Locale
get
 

Constructor Detail

HexLocale

public HexLocale()
Method Detail

put

public void put(MetaObject meta,
                Position pos)
Puts an object into the environment at a given position.

Specified by:
put in interface Locale
Parameters:
meta - the MetaObject to add
pos - the Position to add the object at

put

public void put(MetaObject meta)
Puts an object into the environment at the first open position.

Specified by:
put in interface Locale
Parameters:
meta - the MetaObject to add

get

public MetaObject get(Position pos)
Gets the object at a given position

Specified by:
get in interface Locale
Parameters:
pos - The position to fetch the object from
Returns:
The requested object

get

public MetaObject get(java.lang.String name)
Gets an object by a given name

Specified by:
get in interface Locale
Parameters:
name - The name of the object to get
Returns:
The requested object

get

public MetaObject get(int objectID)
Specified by:
get in interface Locale

remove

public void remove(MetaObject meta)
Specified by:
remove in interface Locale

remove

public void remove(java.lang.String name)
Specified by:
remove in interface Locale

remove

public void remove(int objectID)
Specified by:
remove in interface Locale

move

public void move(MetaObject meta,
                 Position newPos)
Specified by:
move in interface Locale

move

public void move(Position oldPos,
                 Position newPos)
Specified by:
move in interface Locale

isEmpty

public boolean isEmpty(Position pos)
Specified by:
isEmpty in interface Locale

allObjects

public MetaObject[] allObjects()
Specified by:
allObjects in interface Locale

getNamedPoint

public Position getNamedPoint(java.lang.String key)
Specified by:
getNamedPoint in interface Locale

setNamedPoint

public void setNamedPoint(java.lang.String key,
                          Position pos)
Specified by:
setNamedPoint in interface Locale

isInLocale

public boolean isInLocale(MetaObject meta)
Specified by:
isInLocale in interface Locale

peek

public MetaObject peek(Position pos)
Specified by:
peek in interface Locale