aboutsummaryrefslogtreecommitdiff
path: root/internal/game/cmd_bank.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/game/cmd_bank.go')
-rw-r--r--internal/game/cmd_bank.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/internal/game/cmd_bank.go b/internal/game/cmd_bank.go
index ff3a3ac..0785b81 100644
--- a/internal/game/cmd_bank.go
+++ b/internal/game/cmd_bank.go
@@ -5,9 +5,9 @@ import (
"sort"
"strings"
+ "thehouseoficarus/internal/action"
"thehouseoficarus/internal/net"
"thehouseoficarus/internal/player"
- "thehouseoficarus/internal/world"
)
func (g *Game) handleBankInput(sess *net.Session, input string) {
@@ -57,7 +57,7 @@ func (g *Game) writeBankPrompt(sess *net.Session) {
}
func (g *Game) showBankBrowse(sess *net.Session) {
- p, _ := sess.Player.(*player.Player)
+ p := sess.Player
unicode := p.OptionBool("unicode")
@@ -110,7 +110,7 @@ func (g *Game) showBankBrowse(sess *net.Session) {
}
func (g *Game) doBankDeposit(sess *net.Session, input string) {
- p, _ := sess.Player.(*player.Player)
+ p := sess.Player
matches := g.findInventoryMatches(input, p)
if len(matches) == 0 {
@@ -158,7 +158,7 @@ func (g *Game) doBankDeposit(sess *net.Session, input string) {
}
func (g *Game) doBankDepositAll(sess *net.Session) {
- p, _ := sess.Player.(*player.Player)
+ p := sess.Player
var deposited int
for i := 0; i < 28; i++ {
@@ -187,7 +187,7 @@ func (g *Game) doBankDepositAll(sess *net.Session) {
}
func (g *Game) doBankWithdraw(sess *net.Session, input string) {
- p, _ := sess.Player.(*player.Player)
+ p := sess.Player
freeSlot := p.FirstFreeSlot()
if freeSlot == -1 {
@@ -235,7 +235,7 @@ func (g *Game) doBankWithdraw(sess *net.Session, input string) {
}
lower := strings.ToLower(input)
for _, e := range entries {
- if world.WordPrefixMatch(e.name, lower) {
+ if action.WordPrefixMatch(e.name, lower) {
matches = append(matches, e)
}
}
@@ -326,7 +326,7 @@ func (g *Game) canUseBank(p *player.Player) bool {
}
func (g *Game) doBank(sess *net.Session) {
- p, _ := sess.Player.(*player.Player)
+ p := sess.Player
if !g.canUseBank(p) {
sess.WriteLine("There is no bank here.")