lite-ts-activity
v11.14.1
Published
活动库
Downloads
9
Readme
代码
ActivityServiceBase - 活动服务
const service: ActivityServiceBase;
// 玩家数值
const res = await service.userValue;
// 关闭时间
const res = await service.closeOn;
// 隐藏时间
const res = await service.hideOn;
// 开启时间
const res = await service.openOn;
// 获取剩余时间
const uow: UnitOfWorkBase;
const res = await service.getRemainTime(uow);
- ActivityConditionService - 条件
const enumItem: ActivityData;
const time: TimeBase;
const valueService: ValueService;
const factory: ActivityFactoryBase;
const nowTime: NowTimeBase;
const service: ActivityServiceBase = new ActivityConditionService(
enumItem,
time,
valueService,
factory,
nowTime,
);
- ActivityRangeService - 区间
const enumItem: ActivityData;
const time: TimeBase;
const valueService: ValueService;
const factory: ActivityFactoryBase;
const nowTime: NowTimeBase;
const service: ActivityServiceBase = new ActivityRangeService(
enumItem,
time,
valueService,
factory,
nowTime,
);
ActivityFactoryBase - 活动工厂
const factory: ActivityFactoryBase;
// 玩家数据
const res = await factory.userEntry;
// 创建服务
const uow: UnitOfWorkBase;
const res = factory.build(uow, 视图编号);
- ActivityRpcFactory - 基于rpc实现
const pc: RpcBase;
const enumFactory: EnumFactoryBase;
const nowTime: NowTimeBase;
const time: TimeBase;
const valueService: ValueService;
const factory: ActivityFactoryBase = new ActivityRpcFactory(
rpc,
enumFactory,
nowTime,
time,
valueService,
项目编号,
);