C# 클래스 Terrarium.Game.PopulationData

파일 보기 프로젝트 열기: eugeniomiro/Terrarium 1 사용 예제들

공개 메소드들

메소드 설명
AddToTotals ( DataSet &totalsData, DataSet newData ) : void

Add up reporting totals so that a cumulative report can be given to the user via a dialog or other method.

BeginTick ( int tickNumber, System.Guid guid ) : void

Begins a game engine tick indicating the tick number and the world state GUID.

Close ( ) : void

Closes the PopulationData class and stops in any progress or pending connections.

CountOrganism ( string speciesName, PopulationChangeReason reason ) : void

Counts a new organism and adds it to the reporting data.

CountOrganism ( string speciesName, PopulationChangeReason reason, int count ) : void

Counts a new organism and adds it to the current dataset.

CreateReportDataSet ( ) : DataSet

Creates a dataset in the form that the reporting server is expecting.

Data ( ) : DataSet

Get the current reporting data.

EndTick ( int tickNumber ) : void

Ends a game tick.

FillReportTable ( DataTable totalsOnlyTable, System.Guid peerStateGuid, int tickNumber ) : void

Fill the dataset with data in the format expected by the reporting server.

GetCurrentReportingStats ( System.Guid peerGuid, int tick ) : DataSet

Gets a dataset of the current reporting statistics. This data can be used to update datagrids, charts, or other reporting facilities.

InitWebService ( ) : void

Initializes the web service proxies. These are dynamically generated and so this method only generates them one time to improve memory and performance.

IsReportingTick ( int tickNumber ) : bool

Determines if the current tick is a reporting tick. We only report data every so often, and a report tick is the tick when we report data.

NullToZero ( object value ) : Int32

Helper function to convert DBNull to 0

PopulationData ( bool reportData, Terrarium.Forms.TerrariumLed led ) : System

Creates a new PopulationData class that can be used to report data and update a status LED.

UncountOrganism ( string speciesName, PopulationChangeReason reason ) : void

Counts a new organism and removes it from the data.

UncountOrganism ( string speciesName, PopulationChangeReason reason, int count ) : void

Counts a new organism and removes it from the reporting data.

비공개 메소드들

메소드 설명
ReportData ( DataSet newData, System.Guid peerStateGuid ) : void

Attemps to report data to the central server.

ReportServiceCallback ( IAsyncResult asyncResult ) : void

Callback method used by the reporting service methods to enable Async reporting.

ResetData ( ) : void

Resets the data in the PopulationData class to initial values.

addValues ( object value1, object value2 ) : Int32

Helper function to add two database values together.

메소드 상세

AddToTotals() 공개 메소드

Add up reporting totals so that a cumulative report can be given to the user via a dialog or other method.
public AddToTotals ( DataSet &totalsData, DataSet newData ) : void
totalsData System.Data.DataSet The current totals data.
newData System.Data.DataSet The new data to be added.
리턴 void

BeginTick() 공개 메소드

Begins a game engine tick indicating the tick number and the world state GUID.
public BeginTick ( int tickNumber, System.Guid guid ) : void
tickNumber int The current tick number.
guid System.Guid The world state GUID.
리턴 void

Close() 공개 메소드

Closes the PopulationData class and stops in any progress or pending connections.
public Close ( ) : void
리턴 void

CountOrganism() 공개 메소드

Counts a new organism and adds it to the reporting data.
public CountOrganism ( string speciesName, PopulationChangeReason reason ) : void
speciesName string The name of the species to add.
reason PopulationChangeReason The reason for bing added.
리턴 void

CountOrganism() 공개 메소드

Counts a new organism and adds it to the current dataset.
public CountOrganism ( string speciesName, PopulationChangeReason reason, int count ) : void
speciesName string The name of the species being added.
reason PopulationChangeReason The reason for being added.
count int The number to add.
리턴 void

CreateReportDataSet() 공개 메소드

Creates a dataset in the form that the reporting server is expecting.
public CreateReportDataSet ( ) : DataSet
리턴 System.Data.DataSet

Data() 공개 메소드

Get the current reporting data.
public Data ( ) : DataSet
리턴 System.Data.DataSet

EndTick() 공개 메소드

Ends a game tick.
public EndTick ( int tickNumber ) : void
tickNumber int The tick number. Should always be the same as the call to BeginTick.
리턴 void

FillReportTable() 공개 메소드

Fill the dataset with data in the format expected by the reporting server.
public FillReportTable ( DataTable totalsOnlyTable, System.Guid peerStateGuid, int tickNumber ) : void
totalsOnlyTable System.Data.DataTable A datatable in the reporting server format.
peerStateGuid System.Guid The current world state GUID.
tickNumber int The current tick number.
리턴 void

GetCurrentReportingStats() 공개 메소드

Gets a dataset of the current reporting statistics. This data can be used to update datagrids, charts, or other reporting facilities.
public GetCurrentReportingStats ( System.Guid peerGuid, int tick ) : DataSet
peerGuid System.Guid The world state GUID for this peer.
tick int The current tick number.
리턴 System.Data.DataSet

InitWebService() 공개 메소드

Initializes the web service proxies. These are dynamically generated and so this method only generates them one time to improve memory and performance.
public InitWebService ( ) : void
리턴 void

IsReportingTick() 공개 메소드

Determines if the current tick is a reporting tick. We only report data every so often, and a report tick is the tick when we report data.
public IsReportingTick ( int tickNumber ) : bool
tickNumber int The current tick number.
리턴 bool

NullToZero() 공개 정적인 메소드

Helper function to convert DBNull to 0
public static NullToZero ( object value ) : Int32
value object The value to check.
리턴 System.Int32

PopulationData() 공개 메소드

Creates a new PopulationData class that can be used to report data and update a status LED.
public PopulationData ( bool reportData, Terrarium.Forms.TerrariumLed led ) : System
reportData bool Should data be reported to the server.
led Terrarium.Forms.TerrariumLed An LED used to indicate status.
리턴 System

UncountOrganism() 공개 메소드

Counts a new organism and removes it from the data.
public UncountOrganism ( string speciesName, PopulationChangeReason reason ) : void
speciesName string The name of the species the data is for.
reason PopulationChangeReason The reason the creature is being removed.
리턴 void

UncountOrganism() 공개 메소드

Counts a new organism and removes it from the reporting data.
public UncountOrganism ( string speciesName, PopulationChangeReason reason, int count ) : void
speciesName string The name of the species the data is for.
reason PopulationChangeReason The reason for removing.
count int The number to remove.
리턴 void