TNet 3  3.0.8
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Macros
TNet.Counter Class Reference

Counter is a value that automatically changes with time. It's ideal for resources. More...

Inheritance diagram for TNet.Counter:
TNet.IBinarySerializable TNet.IDataNodeSerializable

Public Member Functions

 Counter ()
 
 Counter (double value, double rate=0.0, double min=0.0, double max=double.MaxValue)
 
virtual void Serialize (BinaryWriter writer)
 Serialize the object's data into binary format. More...
 
virtual void Deserialize (BinaryReader reader)
 Deserialize the object's data from binary format. More...
 
virtual void Serialize (DataNode node)
 Serialize the object's data into Data Node. More...
 
virtual void Deserialize (DataNode node)
 Deserialize the object's data from Data Node. More...
 
virtual void CopyTo (Counter c)
 Copy the counter's values over to another. More...
 
virtual Counter Clone ()
 Create a copy of this counter. More...
 
double GetPercent (double delta=1.0)
 Given the time delta, calculate how long the resource will last relative to that delta. More...
 
override string ToString ()
 

Public Attributes

double min
 
double max
 
double rate
 

Properties

double storedValue [get]
 Actual stored value. In most cases you will want to use 'value' instead. More...
 
double value [get, set]
 Current value. More...
 

Detailed Description

Counter is a value that automatically changes with time. It's ideal for resources.

Constructor & Destructor Documentation

TNet.Counter.Counter ( )
TNet.Counter.Counter ( double  value,
double  rate = 0.0,
double  min = 0.0,
double  max = double.MaxValue 
)

Member Function Documentation

virtual Counter TNet.Counter.Clone ( )
virtual

Create a copy of this counter.

virtual void TNet.Counter.CopyTo ( Counter  c)
virtual

Copy the counter's values over to another.

virtual void TNet.Counter.Deserialize ( BinaryReader  reader)
virtual

Deserialize the object's data from binary format.

Implements TNet.IBinarySerializable.

virtual void TNet.Counter.Deserialize ( DataNode  node)
virtual

Deserialize the object's data from Data Node.

Implements TNet.IDataNodeSerializable.

double TNet.Counter.GetPercent ( double  delta = 1.0)

Given the time delta, calculate how long the resource will last relative to that delta.

virtual void TNet.Counter.Serialize ( BinaryWriter  writer)
virtual

Serialize the object's data into binary format.

Implements TNet.IBinarySerializable.

virtual void TNet.Counter.Serialize ( DataNode  node)
virtual

Serialize the object's data into Data Node.

Implements TNet.IDataNodeSerializable.

override string TNet.Counter.ToString ( )

Member Data Documentation

double TNet.Counter.max
double TNet.Counter.min
double TNet.Counter.rate

Property Documentation

double TNet.Counter.storedValue
get

Actual stored value. In most cases you will want to use 'value' instead.

double TNet.Counter.value
getset

Current value.


The documentation for this class was generated from the following file: