68 lines
1.8 KiB
Go
68 lines
1.8 KiB
Go
package player
|
|
|
|
// AddCoins adds coins to the player
|
|
func (p *Player) AddCoins(val int64) {
|
|
p.GetInfoStruct().AddCoin(val)
|
|
// TODO: Send update packet to client
|
|
}
|
|
|
|
// RemoveCoins removes coins from the player
|
|
func (p *Player) RemoveCoins(val int64) bool {
|
|
if p.GetInfoStruct().GetCoin() >= val {
|
|
p.GetInfoStruct().SubtractCoin(val)
|
|
// TODO: Send update packet to client
|
|
return true
|
|
}
|
|
return false
|
|
}
|
|
|
|
// HasCoins checks if the player has enough coins
|
|
func (p *Player) HasCoins(val int64) bool {
|
|
return p.GetInfoStruct().GetCoin() >= val
|
|
}
|
|
|
|
// GetCoinsCopper returns the copper coin amount
|
|
func (p *Player) GetCoinsCopper() int32 {
|
|
return p.GetInfoStruct().GetCoinCopper()
|
|
}
|
|
|
|
// GetCoinsSilver returns the silver coin amount
|
|
func (p *Player) GetCoinsSilver() int32 {
|
|
return p.GetInfoStruct().GetCoinSilver()
|
|
}
|
|
|
|
// GetCoinsGold returns the gold coin amount
|
|
func (p *Player) GetCoinsGold() int32 {
|
|
return p.GetInfoStruct().GetCoinGold()
|
|
}
|
|
|
|
// GetCoinsPlat returns the platinum coin amount
|
|
func (p *Player) GetCoinsPlat() int32 {
|
|
return p.GetInfoStruct().GetCoinPlat()
|
|
}
|
|
|
|
// GetBankCoinsCopper returns the bank copper coin amount
|
|
func (p *Player) GetBankCoinsCopper() int32 {
|
|
return p.GetInfoStruct().GetBankCoinCopper()
|
|
}
|
|
|
|
// GetBankCoinsSilver returns the bank silver coin amount
|
|
func (p *Player) GetBankCoinsSilver() int32 {
|
|
return p.GetInfoStruct().GetBankCoinSilver()
|
|
}
|
|
|
|
// GetBankCoinsGold returns the bank gold coin amount
|
|
func (p *Player) GetBankCoinsGold() int32 {
|
|
return p.GetInfoStruct().GetBankCoinGold()
|
|
}
|
|
|
|
// GetBankCoinsPlat returns the bank platinum coin amount
|
|
func (p *Player) GetBankCoinsPlat() int32 {
|
|
return p.GetInfoStruct().GetBankCoinPlat()
|
|
}
|
|
|
|
// GetStatusPoints returns the player's status points
|
|
func (p *Player) GetStatusPoints() int32 {
|
|
return p.GetInfoStruct().GetStatusPoints()
|
|
}
|