ActorManagerComponent
请大家关注我的微博:@NormanLin_BadPixel坏像素
/// <summary>
/// 用来管理该服务器上所有的Actor对象
/// </summary>
public class ActorManagerComponent : Component
就如作者所注释的,是用来管理该服务器上所有的Actor对象。这些对象存在
private readonly Dictionary<long, Entity> dictionary = new Dictionary<long, Entity>();
通过
public void Add(Entity entity)
public void Remove(long id)
public Entity Get(long id)
三个方法操作。就是这么简单。
本文介绍了一个用于管理服务器上所有Actor对象的组件——ActorManagerComponent。它通过一个字典存储Actor对象,并提供了添加、删除和获取Actor的方法。

2596

被折叠的 条评论
为什么被折叠?



