Atavism Version 2018.1AGIS API

atavism.agis.objects
Class ResourceNodeGroup

java.lang.Object
  extended by atavism.agis.objects.ResourceNodeGroup
All Implemented Interfaces:
MessageCallback, java.io.Serializable

public class ResourceNodeGroup
extends java.lang.Object
implements java.io.Serializable, MessageCallback

A ResourceNode is an object players can gather items from. The ResourceNode randomly generates its items upon spawn from the items it has been given and allows the player to gather them if they meet the requirements.

Author:
Andrew Harrison
See Also:
Serialized Form

Nested Class Summary
 class ResourceNodeGroup.ResourceNodeEntity
          Sub-class needed for the interpolated world node so a perceiver can be created.
 
Field Summary
 
Fields inherited from interface atavism.msgsys.MessageCallback
NO_FLAGS, RESPONSE_EXPECTED
 
Constructor Summary
ResourceNodeGroup()
           
ResourceNodeGroup(AOVector loc, OID instanceOID)
           
 
Method Summary
 void activate()
          Subscribes the instance to receive certain relevant messages that are sent to the world object created by this instance.
 void addPlayer(OID playerOid)
          Add a player to the update list for this ResourceNode.
 void AddResourceNode(ResourceNode node)
           
 AOVector getLoc()
           
 void handleMessage(Message msg, int flags)
          Deals with the messages the instance has picked up.
 void removePlayer(OID playerOid)
          Removes a player from the ResourceNode.
 void spawn()
          Spawn a world object for the claim.
 void spawn(OID instanceOID)
          An external call to spawn a world object for the claim.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceNodeGroup

public ResourceNodeGroup()

ResourceNodeGroup

public ResourceNodeGroup(AOVector loc,
                         OID instanceOID)
Method Detail

AddResourceNode

public void AddResourceNode(ResourceNode node)

activate

public void activate()
Subscribes the instance to receive certain relevant messages that are sent to the world object created by this instance.


handleMessage

public void handleMessage(Message msg,
                          int flags)
Deals with the messages the instance has picked up.

Specified by:
handleMessage in interface MessageCallback
Parameters:
msg - Message sent from other agent.
flags - Bitwise OR of MessageCallback.NO_FLAGS, MessageCallback.RESPONSE_EXPECTED.

spawn

public void spawn(OID instanceOID)
An external call to spawn a world object for the claim.

Parameters:
instanceOID -

spawn

public void spawn()
Spawn a world object for the claim.


addPlayer

public void addPlayer(OID playerOid)
Add a player to the update list for this ResourceNode. The player will receive data about the node and any updates that occur.

Parameters:
playerOID -

removePlayer

public void removePlayer(OID playerOid)
Removes a player from the ResourceNode. They will no longer receive updates.

Parameters:
playerOID -
removeLastID -

getLoc

public AOVector getLoc()


Copyright © 2018 Dragonsan Studios Sp. z o.o.