lite-ts-user
v11.32.5
Published
```typescript const userService: IUserService;
Downloads
72
Readme
代码
IUserService - 用户服务
const userService: IUserService;
// 会话
const res = userService.sessionData;
// 数值服务
const res = userService.valueService;
// 获取用户模块 例如: 活动服务/养成服务等
const module = userService.getModule<T>('模块名或模块构造函数', 重新加载或覆盖的模块);
- UserService<TOption extends UserModuleDelegateOption> - 用户服务
const sessionData: RpcSession;
const allUserModuleDelegate: AllUserModuleDelegate<UserModuleDelegateOption>;
const moduleDelegateOption: Partial<UserModuleDelegateOption>;
const userService = new UserService(sessionData, allUserModuleDelegate, moduleDelegateOption);
UserFactoryBase<T extends IUserService> - 玩家工厂
const userFactory: UserFactoryBase<IUserService>;
// 创建用户服务
const sessionData: RpcSession;
const res = userFactory.build(sessionData);
DbValueService - 数值服务
- UserValueService - 玩家数值服务
const userService: IUserService;
const nowTime: NowTimeBase;
const buildGetCountHandlerFunc: () => ValueHandlerBase;
const buildUpdateHandlerFunc: () => ValueHandlerBase;
const valueService: UserValueService = new UserValueService(
userService,
nowTime,
buildGetCountHandlerFunc,
buildUpdateHandlerFunc,
);
// 玩家服务
const res = valueService.userService;