pub struct EventTasks {
pub theme: EventTaskTheme,
pub start: Option<DateTime<Local>>,
pub end: Option<DateTime<Local>>,
pub tasks: Vec<Task>,
pub rewards: [RewardChest; 3],
}
Expand description
Information about the tasks, that are based on some event theme
Fields§
§theme: EventTaskTheme
The “theme” the event task has. This is mainly irrelevant
start: Option<DateTime<Local>>
The time at which the event tasks have been set
end: Option<DateTime<Local>>
The time at which the event tasks will reset
tasks: Vec<Task>
The actual tasks you have to complete
rewards: [RewardChest; 3]
The rewards available for completing tasks.
Implementations§
Source§impl EventTasks
impl EventTasks
Sourcepub fn earned_points(&self) -> u32
pub fn earned_points(&self) -> u32
The amount of points you have collected from completing tasks
Sourcepub fn total_points(&self) -> u32
pub fn total_points(&self) -> u32
The amount of points, that are available in total
Sourcepub fn get_available(&self, task_type: TaskType) -> Option<&Task>
pub fn get_available(&self, task_type: TaskType) -> Option<&Task>
Checks if a task of the given type is available and not completed
Sourcepub fn get_uncompleted(&self) -> Vec<&Task>
pub fn get_uncompleted(&self) -> Vec<&Task>
Returns all uncompleted tasks
Sourcepub fn can_open_chest(&self, index: usize) -> bool
pub fn can_open_chest(&self, index: usize) -> bool
Checks if the chest at the given index can be opened
Trait Implementations§
Source§impl Clone for EventTasks
impl Clone for EventTasks
Source§fn clone(&self) -> EventTasks
fn clone(&self) -> EventTasks
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for EventTasks
impl Debug for EventTasks
Source§impl Default for EventTasks
impl Default for EventTasks
Source§fn default() -> EventTasks
fn default() -> EventTasks
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for EventTasks
impl<'de> Deserialize<'de> for EventTasks
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for EventTasks
impl RefUnwindSafe for EventTasks
impl Send for EventTasks
impl Sync for EventTasks
impl Unpin for EventTasks
impl UnwindSafe for EventTasks
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more