func (self *Character) AddSkill(id types.Id) { self.writeLock(func() { if !self.HasSkill(id) { return } if self.Skills == nil { self.Skills = utils.Set{} } self.Skills.Insert(id.Hex()) }) }
func (self *Character) HasSkill(id types.Id) bool { self.ReadLock() defer self.ReadUnlock() return self.Skills.Contains(id.Hex()) }
func (self *Character) RemoveSkill(id types.Id) { self.writeLock(func() { self.Skills.Remove(id.Hex()) }) }