Skip to content

接口手册

Chengzhi Tan edited this page Feb 28, 2018 · 1 revision

单服务器库接口

public interface IAuthManager

./SimCivil/Auth/IAuthManager.cs

public interface IComponent : ICloneable, INotifyPropertyChanged

./SimCivil/Components/IComponent.cs

public interface IController : ITicker

./SimCivil/Controller/IController.cs

public interface ITicker

./SimCivil/ITicker.cs

public interface IMapGenerator

./SimCivil/Map/IMapGenerator.cs

public interface IEntityManager

./SimCivil/Model/IEntityManager.cs

public interface IEntityRepository

./SimCivil/Store/IEntityRepository.cs

public interface IMapRepository

./SimCivil/Store/IMapRepository.cs

public interface IPersistable

./SimCivil/Store/IPersistable.cs

public interface IPlayerRepository

./SimCivil/Store/IPlayerRepository.cs

public interface IPrefabRepository

./SimCivil/Store/IPrefabRepository.cs

服务端客户端交互接口

public interface IAuth

./SimCivil.Contract/IAuth.cs

public interface IPlayerController

./SimCivil.Contract/IPlayerController.cs

public interface IRoleManager

./SimCivil.Contract/IRoleManager.cs

public interface IViewSynchronizer

./SimCivil.Contract/IViewSynchronizer.cs

Orleans分布式服务器库接口

public interface IAccount : IGrainWithStringKey

./SimCivil.Orleans.Interfaces/IAccount.cs

账户actor、负责登陆注册以及角色管理。对应IAuthIRoleManager

索引: 帐户名

public interface IAtlas : IGrainWithIntegerKey

./SimCivil.Orleans.Interfaces/IAtlas.cs

地图集actor、对应一块地图区域,负责其中Tile的管理和生成。地图集坐标由Tile坐标整除Altas尺寸得到

索引:(地图集X坐标 & 0xFFFFFFFF) | (地图集Y坐标 << 32)

public interface IChunk : IGrainWithIntegerKey

./SimCivil.Orleans.Interfaces/IChunk.cs

区块actor、对应一块地图区域,负责处理其中Entity之间的交互与碰撞。区块坐标由Entity坐标整除Chunk尺寸得到。Chunk尺寸与Altas尺寸一般情况不相同。

索引:(区块X坐标 & 0xFFFFFFFF) | (区块Y坐标 << 32)

public interface IComponent : IGrainWithGuidKey

./SimCivil.Orleans.Interfaces/IComponent.cs

public interface IComponent<T> : IComponent

./SimCivil.Orleans.Interfaces/IComponent.cs

组件actor、负责管理单个组件Component T的状态。接口设计应当只涉及变更自身状态并提供一些原子操作函数,可以考虑通过steams或者observer通知状态改变。

索引:组件所属的Entity的ID

public interface IEntity : IGrainWithGuidKey

./SimCivil.Orleans.Interfaces/IEntity.cs

public interface IEntityGroup : IGrainWithIntegerKey

./SimCivil.Orleans.Interfaces/IEntityGroup.cs

public interface IGame : IGrainWithIntegerKey

./SimCivil.Orleans.Interfaces/IGame.cs

public interface IMapGenerator

./SimCivil.Orleans.Interfaces/Service/IMapGenerator.cs

Rpc库接口

public interface ICallWarper

./SimCivil.Rpc/ICallWarper.cs

public interface IRpcSession : IDictionary<string, object>

./SimCivil.Rpc/Session/IRpcSession.cs

public interface ISessionRequred

./SimCivil.Rpc/Session/ISessionRequred.cs