1
0
mirror of https://github.com/osmarks/mycorrhiza.git synced 2024-10-30 03:36:16 +00:00
mycorrhiza/hyphae/empty_hypha.go
Timur Ismagilov ae13fdab43 Delete DoesExist
Now type switches are enforced
2022-02-19 11:31:54 +03:00

41 lines
680 B
Go

package hyphae
import "sync"
type EmptyHypha struct {
sync.RWMutex
canonicalName string
}
func (e *EmptyHypha) CanonicalName() string {
return e.canonicalName
}
func (e *EmptyHypha) DoesExist() bool {
return false
}
func (e *EmptyHypha) HasTextPart() bool {
return false
}
func (e *EmptyHypha) TextPartPath() string {
return ""
}
// NewEmptyHypha returns an empty hypha struct with given name.
func NewEmptyHypha(hyphaName string) *EmptyHypha {
return &EmptyHypha{
canonicalName: hyphaName,
}
}
func FillEmptyHyphaUpToMediaHypha(e *EmptyHypha) *MediaHypha { // sic!
return &MediaHypha{
name: e.CanonicalName(),
TextPath: "",
binaryPath: "",
}
}