This repository has been archived on 2022-10-02. You can view files and clone it, but cannot push or open issues or pull requests.
2021-05-06 13:25:09 +00:00
|
|
|
package twutil
|
2020-06-06 12:28:45 +00:00
|
|
|
|
2020-08-09 15:20:23 +00:00
|
|
|
import (
|
2021-05-06 12:42:37 +00:00
|
|
|
"github.com/tribalwarshelp/shared/tw/twmodel"
|
2020-08-09 15:20:23 +00:00
|
|
|
)
|
2020-06-06 12:28:45 +00:00
|
|
|
|
2021-05-06 12:42:37 +00:00
|
|
|
func IsPlayerNil(player *twmodel.Player) bool {
|
2020-08-09 15:20:23 +00:00
|
|
|
return player == nil
|
|
|
|
}
|
|
|
|
|
2021-05-06 12:42:37 +00:00
|
|
|
func IsPlayerTribeNil(player *twmodel.Player) bool {
|
2020-08-09 15:20:23 +00:00
|
|
|
return IsPlayerNil(player) || player.Tribe == nil
|
|
|
|
}
|
|
|
|
|
2021-05-06 12:42:37 +00:00
|
|
|
func IsVillageNil(village *twmodel.Village) bool {
|
2020-08-09 15:20:23 +00:00
|
|
|
return village == nil
|
|
|
|
}
|