Skip to content

Commit

Permalink
fix: current map
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangliang committed Jan 11, 2022
1 parent ccc30ce commit 443b53c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions pkg/agent/tick.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ package agent

import (
"context"
"github.com/AsynkronIT/protoactor-go/actor"
"github.com/magicsea/behavior3go/core"
"strconv"
"sync"
"sync/atomic"
"time"

"github.com/AsynkronIT/protoactor-go/actor"
"github.com/magicsea/behavior3go/core"
)

type One interface {
Expand All @@ -18,6 +20,7 @@ type Market struct {
hub chan One
amount int
roster map[string]One
sync.Mutex
}

func newMarket(amount int) *Market {
Expand Down Expand Up @@ -56,7 +59,9 @@ func (h *Market) JoinOne(one One) {
}

func (h *Market) UseOne(one One) {
h.Lock()
h.roster[one.ID()] = one
h.Unlock()
}

func (h *Market) InviteOne() One {
Expand Down

0 comments on commit 443b53c

Please sign in to comment.