初始化捏

This commit is contained in:
des
2026-03-06 00:07:44 +08:00
commit 1271ceeee7
6 changed files with 67 additions and 0 deletions

21
pasture/dog.go Normal file
View File

@@ -0,0 +1,21 @@
package pasture
type Dog struct {
lines string
weapon string
}
func (d *Dog) Sound() string {
return d.lines
}
func (d *Dog) Dangers() bool {
if len(d.weapon) == 0 {
return false
}
return true
}
func NewDog(line string) *Dog {
return &Dog{lines: line}
}

13
pasture/sheep.go Normal file
View File

@@ -0,0 +1,13 @@
package pasture
type Sheep struct {
lines string
}
func (s *Sheep) Sound() string {
return s.lines
}
func NewSheep(line string) *Sheep {
return &Sheep{lines: line}
}