Reorganize state
This commit is contained in:
49
state/cursor.go
Normal file
49
state/cursor.go
Normal file
@ -0,0 +1,49 @@
|
||||
package state
|
||||
|
||||
func (s *State) CursorCellUp() {
|
||||
if s.cursor.Y >= 1 {
|
||||
s.cursor.Y--
|
||||
}
|
||||
}
|
||||
|
||||
func (s *State) CursorCellDown() {
|
||||
if s.cursor.Y < s.size()-1 {
|
||||
s.cursor.Y++
|
||||
}
|
||||
}
|
||||
|
||||
func (s *State) CursorCellRight() {
|
||||
if s.cursor.X < s.size()-1 {
|
||||
s.cursor.X++
|
||||
}
|
||||
}
|
||||
|
||||
func (s *State) CursorCellLeft() {
|
||||
if s.cursor.X >= 1 {
|
||||
s.cursor.X--
|
||||
}
|
||||
}
|
||||
|
||||
func (s *State) CursorSectionUp() {
|
||||
if s.cursor.Y >= s.cellsPerSection {
|
||||
s.cursor.Y -= s.cellsPerSection
|
||||
}
|
||||
}
|
||||
|
||||
func (s *State) CursorSectionDown() {
|
||||
if s.cursor.Y < s.size()-s.cellsPerSection {
|
||||
s.cursor.Y += s.cellsPerSection
|
||||
}
|
||||
}
|
||||
|
||||
func (s *State) CursorSectionRight() {
|
||||
if s.cursor.X < s.size()-s.cellsPerSection {
|
||||
s.cursor.X += s.cellsPerSection
|
||||
}
|
||||
}
|
||||
|
||||
func (s *State) CursorSectionLeft() {
|
||||
if s.cursor.X >= s.cellsPerSection {
|
||||
s.cursor.X -= s.cellsPerSection
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user