package game import ( "fmt" "sirlab.de/go/knyt/quote" ) func (gm *Game) CreateQuote(fileName, usrId, quoteId, quoteText string) error { qu := quote.NewQuote(quoteId, usrId, quoteText) return qu.Save(fileName) } func (gm *Game) SaveQuote(fileName, usrId, quoteId, quoteText string) error { qu, err := gm.getQuoteById(quoteId) if err != nil { return err } if qu.GetSourceId() != usrId { return fmt.Errorf("usrId does not match quote source id") } qu.SetQuote(quoteText) return qu.Save(fileName) }