Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## sema
Class Nature

    java.lang.Object
      sema.Nature

public class Nature
extends java.lang.Object

The Nature gouverning the world. It links the time and the space, and all the physics laws. It manage the global event of the world, the broadcast of signals, the visibility, the rain etc ....

Nested Class Summary
`class` | `Nature.CanSee` Selector determinating if his element can see some other.
`protected class` | `Nature.GoodKind` Generic `Selector` to select the elements of a given kind.

Constructor Summary
`Nature(Engine engine, Map map)` Constructs a Nature from the engine and a map : the Nature is a link between the time and the space.

Method Summary
`void` | `broadcastSignal(Signal sig)` Broadcast a signal in the world.
`Nature.CanSee` | `getCanSee(Element el)` Method returning an implementation of the Selector CanSee
`float` | `getDistance(Element element1, Element element2)` Returns the distance between two elements.
`java.util.TreeMap` | `getElements(Area area)` Returns the elements in the boxes intersected by the given area.
`Nature.GoodKind` | `getGoodKind(java.lang.String kind)` Returns an implementation of GoodKind.
`protected java.lang.String[][]` | `getProperties()` Returns the properties of the nature.
`protected void` | `setProperties(java.lang.String property, java.lang.String value)` Try to sets the value to the property of the nature.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### Nature

    public Nature(Engine engine,
                  Map map)

  Constructs a Nature from the engine and a map : the Nature is a link between the time and the space. Instancie une nature à partir d'un moteur et d'une carte (la nature est un lien entre temps et espace).

Method Detail

### getElements

    public java.util.TreeMap getElements(Area area)

  Returns the elements in the boxes intersected by the given area. The efficientness depends also of the boxes thinness.

### getDistance

    public float getDistance(Element element1,
                             Element element2)

  Returns the distance between two elements.

### broadcastSignal

    public void broadcastSignal(Signal sig)

  Broadcast a signal in the world.

### getCanSee

    public Nature.CanSee getCanSee(Element el)

  Method returning an implementation of the Selector CanSee

### getGoodKind

    public Nature.GoodKind getGoodKind(java.lang.String kind)

  Returns an implementation of GoodKind.

### getProperties

    protected java.lang.String[][] getProperties()

  Returns the properties of the nature.

  Returns:
    the element's properties.
  See Also:
    `Engine.getProperties()`

### setProperties

    protected void setProperties(java.lang.String property,
                                 java.lang.String value)

  Try to sets the value to the property of the nature. The new value is ignored if the property is read_only or if the value isn't valid.

  Parameters:
    `property` - the property to change.
    `value` - the new value for the property.
  See Also:
    `Engine.setProperties(java.lang.String, java.lang.String)`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD