Atavism Version 2018.1AGIS API

atavism.agis.core
Class DCMap

java.lang.Object
  extended by atavism.agis.core.DCMap
All Implemented Interfaces:
Marshallable, java.io.Serializable

public class DCMap
extends java.lang.Object
implements java.io.Serializable, Marshallable

maps a base DC to an item specific DC you have an item like a leather tunic, and you want to put that on a human female. which meshes do you use? this maps from a base dc (like human_female.mesh and the nude submeshes) to the dc you should use for the item, such as human_female_tunic.mesh at some point we want to add 'state' like whether you are in combat or not and also equipslot into the mix

See Also:
Serialized Form

Constructor Summary
DCMap()
           
 
Method Summary
 void add(DisplayContext base, DisplayContext target)
           
 DisplayContext get(DisplayContext base)
          returns corresponding DC.
 DisplayContext getDefault()
          sometimes you want to set a default mapping.
 java.util.Map<DisplayContext,DisplayContext> getMap()
           
 void marshalObject(AOByteBuffer buf)
          Marshal the object into the byte buffer argument.
 void setDefault(DisplayContext dc)
           
 void setMap(java.util.Map<DisplayContext,DisplayContext> map)
           
 java.lang.Object unmarshalObject(AOByteBuffer buf)
          Unmarshal from the byte buffer argument, returning an Object that containing the unmarshalled state.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DCMap

public DCMap()
Method Detail

add

public void add(DisplayContext base,
                DisplayContext target)

get

public DisplayContext get(DisplayContext base)
returns corresponding DC. if there is none, this method will return the defaultDC (possibly null) there is a match when the map has an entry that is a subset of the passed in base (not the other way around). usually the base of a mob has a head and other parts which we should disregard


getDefault

public DisplayContext getDefault()
sometimes you want to set a default mapping. this is used when there is no match for the base model. this is useful when you have an item that is always the same regardless of the base mesh


setDefault

public void setDefault(DisplayContext dc)

getMap

public java.util.Map<DisplayContext,DisplayContext> getMap()

setMap

public void setMap(java.util.Map<DisplayContext,DisplayContext> map)

marshalObject

public void marshalObject(AOByteBuffer buf)
Description copied from interface: Marshallable
Marshal the object into the byte buffer argument.

Specified by:
marshalObject in interface Marshallable
Parameters:
buf - The byte buffer

unmarshalObject

public java.lang.Object unmarshalObject(AOByteBuffer buf)
Description copied from interface: Marshallable
Unmarshal from the byte buffer argument, returning an Object that containing the unmarshalled state. Nearly all implementors of Marshallable unmarshall the state into this, and return this. However, some implementors need to "intern" the result of unmarshalling, and will potentially return a value different from this. This provides the functionality of Java Serializable's readResolve() method. Examples in the server of classes that intern objects during unmarshalling include MessageType and Namespace.

Specified by:
unmarshalObject in interface Marshallable


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