yaze 0.2.0
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
sprite_builder.cc
Go to the documentation of this file.
1#include "sprite_builder.h"
2
3#include <sstream>
4#include <string>
5
6namespace yaze {
7namespace app {
8namespace zelda3 {
9
10SpriteBuilder SpriteBuilder::Create(const std::string& spriteName) {
11 SpriteBuilder builder;
12
13 return builder;
14}
15
16SpriteBuilder& SpriteBuilder::SetProperty(const std::string& propertyName,
17 const std::string& value) {
18 return *this;
19}
20
21SpriteBuilder& SpriteBuilder::SetProperty(const std::string& propertyName,
22 int value) {
23 return *this;
24}
25
26SpriteBuilder& SpriteBuilder::SetProperty(const std::string& propertyName,
27 bool value) {
28 return *this;
29}
30
32 return *this;
33}
34
36 return *this;
37}
38
40 return *this;
41}
42
43SpriteBuilder& SpriteBuilder::AddFunction(const std::string& asmCode) {
44 return *this;
45}
46
47std::string SpriteBuilder::BuildProperties() const {
48 std::stringstream ss;
49 // Build the properties
50 for (int i = 0; i < 27; ++i) {
51 std::string property = "00";
52 if (!properties[i].empty()) property = properties[i];
53 ss << kSpriteProperties[i] << " = $" << property << std::endl;
54 }
55 return ss.str();
56}
57
58std::string SpriteBuilder::Build() const {
59 std::stringstream ss;
60 ss << BuildProperties();
61 return ss.str();
62}
63
64// ============================================================================
65
66SpriteAction SpriteAction::Create(const std::string& actionName) {
67 SpriteAction action;
68
69 return action;
70}
71
73 SpriteAction action;
74
75 return action;
76}
77
79 const SpriteInstruction& instruction) {
80 return *this;
81}
82
84 return *this;
85}
86
87SpriteAction& SpriteAction::SetNextAction(const std::string& nextActionName) {
88 return *this;
89}
90
91std::string SpriteAction::GetConfiguration() const { return ""; }
92
93// ============================================================================
94
96 int speed) {
97 SpriteInstruction instruction;
98
99 return instruction;
100}
101
103 SpriteInstruction instruction;
104 instruction.SetConfiguration("JSL Sprite_ApplySpeedTowardsPlayer");
105 return instruction;
106}
107
109 SpriteInstruction instruction;
110
111 return instruction;
112}
113
115 SpriteInstruction instruction;
116
117 return instruction;
118}
119
121 SpriteInstruction instruction;
122
123 return instruction;
124}
125
127 SpriteInstruction instruction;
128
129 return instruction;
130}
131
132SpriteInstruction SpriteInstruction::Custom(const std::string& asmCode) {
133 SpriteInstruction instruction;
134
135 return instruction;
136}
137
139 SpriteInstruction instruction;
140
141 return instruction;
142}
143
145 const std::string& functionName) {
146 SpriteInstruction instruction;
147
148 return instruction;
149}
150
151} // namespace zelda3
152} // namespace app
153} // namespace yaze
SpriteAction & AddInstruction(const SpriteInstruction &instruction)
SpriteAction & SetNextAction(const std::string &nextActionName)
std::string GetConfiguration() const
SpriteAction & AddCustomInstruction(const std::string &asmCode)
SpriteBuilder & AddFunction(const std::string &asmCode)
std::string BuildProperties() const
SpriteBuilder & SetGlobalAction(const SpriteAction &action)
std::array< std::string, 27 > properties
static SpriteBuilder Create(const std::string &spriteName)
SpriteBuilder & AddAction(const SpriteAction &action)
SpriteBuilder & SetProperty(const std::string &propertyName, const std::string &value)
static SpriteInstruction PlayAnimation(int startFrame, int endFrame, int speed)
static SpriteInstruction CheckDamageFromPlayer()
static SpriteInstruction BounceFromTileCollision()
static SpriteInstruction Custom(const std::string &asmCode)
static SpriteInstruction MoveXyz()
static SpriteInstruction SetTimer(int timerId, int value)
void SetConfiguration(const std::string &instruction)
static SpriteInstruction ApplySpeedTowardsPlayer(int speed)
static SpriteInstruction JumpToFunction(const std::string &functionName)
static SpriteInstruction BehaveAsBarrier()
constexpr const char * kSpriteProperties[]
Definition common.cc:22