yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
yaze::editor::ScratchWorkspace Class Reference

#include <scratch_workspace.h>

Collaboration diagram for yaze::editor::ScratchWorkspace:

Public Member Functions

const ScratchWorkspaceState & state () const
 
void Restore (const ScratchWorkspaceState &state)
 
ScratchPage & current ()
 
const ScratchPage & current () const
 
bool Select (uint64_t id)
 
absl::Status AddPage (bool duplicate=false)
 
absl::Status DeletePage ()
 
absl::Status Rename (absl::string_view name)
 
absl::Status Resize (int width, int height)
 
absl::Status Stamp (const TileBrush &brush, int x, int y)
 
absl::Status Capture (const TileBrush &brush, int source_map)
 
void Clear ()
 
absl::Status Parse (absl::string_view contents)
 
std::string Serialize () const
 
absl::Status Load (const std::filesystem::path &path)
 
absl::Status Save (const std::filesystem::path &path)
 

Static Public Attributes

static constexpr size_t kMaxPages = 32
 

Private Attributes

ScratchWorkspaceState state_
 
std::optional< std::string > saved_contents_
 
bool file_loaded_ = false
 

Detailed Description

Definition at line 40 of file scratch_workspace.h.

Member Function Documentation

◆ state()

◆ Restore()

void yaze::editor::ScratchWorkspace::Restore ( const ScratchWorkspaceState & state)

Definition at line 138 of file scratch_workspace.cc.

References yaze::editor::ScratchWorkspaceState::next_id, state(), and state_.

Referenced by yaze::editor::OverworldEditor::RestoreScratchState().

Here is the call graph for this function:

◆ current() [1/2]

◆ current() [2/2]

const ScratchPage & yaze::editor::ScratchWorkspace::current ( ) const

Definition at line 150 of file scratch_workspace.cc.

References yaze::editor::ScratchWorkspaceState::pages, and state_.

◆ Select()

◆ AddPage()

◆ DeletePage()

◆ Rename()

absl::Status yaze::editor::ScratchWorkspace::Rename ( absl::string_view name)

Definition at line 180 of file scratch_workspace.cc.

References current(), and yaze::editor::ScratchPage::name.

Referenced by yaze::editor::OverworldEditor::DrawScratchSpace().

Here is the call graph for this function:

◆ Resize()

absl::Status yaze::editor::ScratchWorkspace::Resize ( int width,
int height )

Definition at line 201 of file scratch_workspace.cc.

References current(), yaze::editor::ScratchPage::height, and yaze::editor::ScratchPage::width.

Referenced by yaze::editor::OverworldEditor::DrawScratchSpace().

Here is the call graph for this function:

◆ Stamp()

absl::Status yaze::editor::ScratchWorkspace::Stamp ( const TileBrush & brush,
int x,
int y )

◆ Capture()

absl::Status yaze::editor::ScratchWorkspace::Capture ( const TileBrush & brush,
int source_map )

Definition at line 223 of file scratch_workspace.cc.

References AddPage(), current(), yaze::editor::TileBrush::height, Stamp(), yaze::editor::TileBrush::valid(), and yaze::editor::TileBrush::width.

Here is the call graph for this function:

◆ Clear()

void yaze::editor::ScratchWorkspace::Clear ( )

Definition at line 240 of file scratch_workspace.cc.

References current().

Here is the call graph for this function:

◆ Parse()

absl::Status yaze::editor::ScratchWorkspace::Parse ( absl::string_view contents)

◆ Serialize()

std::string yaze::editor::ScratchWorkspace::Serialize ( ) const

◆ Load()

absl::Status yaze::editor::ScratchWorkspace::Load ( const std::filesystem::path & path)

Definition at line 308 of file scratch_workspace.cc.

References file_loaded_, Parse(), saved_contents_, and state_.

Referenced by yaze::editor::OverworldEditor::LoadScratchPad().

Here is the call graph for this function:

◆ Save()

absl::Status yaze::editor::ScratchWorkspace::Save ( const std::filesystem::path & path)

Member Data Documentation

◆ kMaxPages

constexpr size_t yaze::editor::ScratchWorkspace::kMaxPages = 32
staticconstexpr

◆ state_

ScratchWorkspaceState yaze::editor::ScratchWorkspace::state_
private

Definition at line 65 of file scratch_workspace.h.

Referenced by AddPage(), current(), DeletePage(), Load(), Parse(), Restore(), Select(), Serialize(), and state().

◆ saved_contents_

std::optional<std::string> yaze::editor::ScratchWorkspace::saved_contents_
private

Definition at line 66 of file scratch_workspace.h.

Referenced by Load(), and Save().

◆ file_loaded_

bool yaze::editor::ScratchWorkspace::file_loaded_ = false
private

Definition at line 67 of file scratch_workspace.h.

Referenced by Load(), and Save().


The documentation for this class was generated from the following files: