Documentation ¶
Index ¶
- func Abs(a int) int
- func Max(a, b int) int
- func MaxByDir(a, b int, dir Direction) int
- func Mid(a, b, c int) int
- func Min(a, b int) int
- func MinByDir(a, b int, dir Direction) int
- func Pow(base, power uint) uint64
- func Seq(a, b int) (int, int)
- func SeqByDir(a, b int, dir Direction) (int, int)
- type Direction
- type Region
- func (r *Region) Adjust(position, delta int)
- func (r Region) Begin() int
- func (r Region) Clip(r2 Region) Region
- func (r Region) Combine(r2 Region) Region
- func (r Region) Contains(point int) bool
- func (r Region) Cover(r2 Region) bool
- func (r Region) Cut(r2 Region) (ret []Region)
- func (r Region) Empty() bool
- func (r Region) End() int
- func (r Region) Intersection(r2 Region) (ret Region)
- func (r Region) Intersects(r2 Region) bool
- func (r Region) MidIn(point int) bool
- func (r Region) RealFrom() int
- func (r Region) RealTo() int
- func (r Region) Size() int
- func (r Region) String() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Region ¶
Region from point From to To. From must be less than To, real direction is decide by the Dir field
func (*Region) Adjust ¶
Adjust apply the change in the position with delta(the change) to the region if need if point is after changed position, it must change also else if point is before the changed position, if the delta do not affect the point, needn't change point else apply the change also
func (Region) Clip ¶
Clip return the cliped against another region if r is inside r2 or r2 inside r, return r, else return r that remove intesect part
func (Region) Intersection ¶
Intersection returns the region that is the intersection of the two
func (Region) Intersects ¶
Intersects check whether the two regions intersects
Click to show internal directories.
Click to hide internal directories.