BuffTimeoutAction.cs 455 B

1234567891011121314151617181920
  1. using Common.Event;
  2. using Model;
  3. using MongoDB.Bson;
  4. namespace Controller
  5. {
  6. [Action(ActionType.BuffTimeoutAction)]
  7. public class BuffTimeoutAction: IEventSync
  8. {
  9. public void Run(Env env)
  10. {
  11. Unit owner = World.Instance.GetComponent<UnitComponent>().Get(env.Get<ObjectId>(EnvKey.OwnerId));
  12. if (owner == null)
  13. {
  14. return;
  15. }
  16. owner.GetComponent<BuffComponent>().RemoveById(env.Get<ObjectId>(EnvKey.BuffId));
  17. }
  18. }
  19. }