Ejemplo n.º 1
0
func getShipColor(field *engine.Field) string {
	if field.IsHit {
		if field.IsEmpty() {
			return CELL_MISS_COLOR
		}
		if field.ShipPart.Ship.IsSunken() {
			return field.ShipPart.Ship.Player.Color.HitAndSunk
		}
		return field.ShipPart.Ship.Player.Color.Hit
	}

	return CELL_BASE_COLOR
}