tile_occupy.go 676 B

1234567891011121314151617181920212223242526272829303132
  1. package event
  2. import (
  3. eventBase "f1-game/internal/event/base"
  4. nameEvent "f1-game/internal/name/event"
  5. "f1-game/internal/pb"
  6. )
  7. type TileOccupy struct {
  8. eventBase.PairEvent[*pb.I32I32, *pb.I64]
  9. }
  10. func NewTileOccupy(playerID, ownerPlayerID int64, configID, level int32) *TileOccupy {
  11. return &TileOccupy{
  12. PairEvent: eventBase.NewPairEvent(playerID, nameEvent.Map_PlayerTileOccupy, &pb.I32I32{
  13. Key: configID,
  14. Value: level,
  15. }, &pb.I64{Value: ownerPlayerID}),
  16. }
  17. }
  18. func (p *TileOccupy) ConfigID() int32 {
  19. return p.Key().Key
  20. }
  21. func (p *TileOccupy) Level() int32 {
  22. return p.Key().Value
  23. }
  24. func (p *TileOccupy) OwnerPlayerID() int64 {
  25. return p.Value().Value
  26. }