C# Class HelloWorld.GameDataItem

定义游戏数据对象的抽象实现
Inheritance: IDataHost
Show file Open project: Ivony/HelloWorld Class Usage Examples

Private Properties

Property Type Description
IDataHost void
InitializeData void
InitializeData void
SaveAsJson string

Protected Methods

Method Description
BeginSaveTransaction ( ) : IDisposable

开始一个保存事务,在该对象销毁时,所有修改才会被写入

EnsureInitialized ( ) : void
GameDataItem ( ) : System
Initialize ( ) : void

初始化对象

Save ( ) : void

通知数据服务保存数据对象

Private Methods

Method Description
IDataHost ( JToken dataItem ) : void
InitializeData ( IGameDataService dataService, GameDataItem host, JsonDataObject data ) : void

从 JSON 数据中初始化对象

InitializeData ( IGameDataService dataService, Newtonsoft.Json.Linq.JObject data ) : void

从 JSON 数据中初始化对象

SaveAsJson ( ) : string

Method Details

BeginSaveTransaction() protected method

开始一个保存事务,在该对象销毁时,所有修改才会被写入
protected BeginSaveTransaction ( ) : IDisposable
return IDisposable

EnsureInitialized() protected method

protected EnsureInitialized ( ) : void
return void

GameDataItem() protected method

protected GameDataItem ( ) : System
return System

Initialize() protected method

初始化对象
protected Initialize ( ) : void
return void

Save() protected method

通知数据服务保存数据对象
protected Save ( ) : void
return void