[−][src]Struct liriodendron::log::tools::grids::Grids
Represents user interface set of grids
Fields
current_grid_id: usize
current_grid: Grid
names: Vec<String>
Names of grids
error: String
If an error occured during an operation, a String is made to be displayed on the graphic interface
height: u16
width: u16
scroll_x: u16
Determines the visible part of the grid when user interface grid area is smaller than the grid
scroll_y: u16
Determines the visible part of the grid when user interface grid area is smaller than the grid
state: HashMap<Cell, FullPixel>
Grids' filled cells
map_capacity: usize
Customizable member
switch_cursor: usize
Determines which grid will be swapped with the current grid
Methods
impl Grids
[src]
pub fn new(map_capacity: usize) -> Grids
[src]
pub fn get_current_grid_info(&self) -> (Grid, usize)
[src]
pub fn is_on_current_grid(&self, id: usize, grid: Grid) -> bool
[src]
pub fn get_length_capacity_state(&self) -> (usize, usize)
[src]
pub fn get_current_grid(&self) -> Vec<(FullPixel, u16, u16)>
[src]
Returns current grid's filled cells in a Vec of tuples (cell content, cell X coordinate, cell Y coordinate)
pub fn get_names(&self) -> Vec<String>
[src]
pub fn get_nb(&self) -> usize
[src]
pub fn is_full(&self) -> bool
[src]
pub fn is_alone(&self) -> bool
[src]
fn clear_current_grid(&mut self)
[src]
fn add(&mut self, name: String)
[src]
fn rename_current_grid(&mut self, name: String)
[src]
fn delete_current_grid(&mut self)
[src]
Clears content of the current grid, deletes it and decrements the grid id of cells with a grid id greater than the deleted grid
fn switch_current_grid(&mut self, switched_grid: usize)
[src]
switched_grid is a data from the userinterface where names of each grid is displayed except the current grid. So if the switched_grid has a greater id than the current grid, this switched_grid has a userinterface id equal to its log id minus 1. So when this data arrived in this function, we have to increments it to match with this userinterface representation to the log representation.
pub fn get_switch_cursor(&self) -> usize
[src]
pub fn next_switch_cursor(&mut self)
[src]
pub fn previous_switch_cursor(&mut self)
[src]
pub fn check_name(&mut self, name: String) -> Option<[char; 16]>
[src]
Chechs if the name typed by the user have a length between 1 and 16 and if the name is not already used
pub fn error_occured(&self) -> bool
[src]
pub fn get_error(&self) -> String
[src]
pub fn next(&mut self)
[src]
pub fn previous(&mut self)
[src]
pub fn get_nb_filledcells_current_grid(&self) -> usize
[src]
pub fn get_grids(&self) -> HashMap<(u16, u16), (usize, FullPixel)>
[src]
Returns grids' filled cells in a HashMap of key-tuples (cell X coordinate, cell Y coordinate) and value-tuples (grid ID, cell content)
pub fn update(&mut self, action: &Action) -> (Option<FullPixel>, bool)
[src]
Updates state depending of action. Returns the old value if action deletes of modifies a value in state. Returns a bool for the user interface if action inserts and overflows state capacity.
pub fn get_grid_width(&self) -> u16
[src]
pub fn get_grid_height(&self) -> u16
[src]
fn increment_width(&mut self)
[src]
fn decrement_width(&mut self)
[src]
fn increment_height(&mut self)
[src]
fn decrement_height(&mut self)
[src]
pub fn get_scroll(&self) -> (u16, u16)
[src]
pub fn check_scroll(&mut self, (area_width, area_height): &(u16, u16))
[src]
pub fn scroll_up(&mut self)
[src]
pub fn scroll_down(&mut self)
[src]
pub fn scroll_left(&mut self)
[src]
pub fn scroll_right(&mut self)
[src]
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Grids
impl Send for Grids
impl Sync for Grids
impl Unpin for Grids
impl UnwindSafe for Grids
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> SetParameter for T
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
T: Parameter<Self>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,