yaze 0.3.2
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 zelda3 {
8
9SpriteBuilder SpriteBuilder::Create(const std::string& spriteName) {
10 SpriteBuilder builder;
11
12 return builder;
13}
14
15SpriteBuilder& SpriteBuilder::SetProperty(const std::string& propertyName,
16 const std::string& value) {
17 return *this;
18}
19
20SpriteBuilder& SpriteBuilder::SetProperty(const std::string& propertyName,
21 int value) {
22 return *this;
23}
24
25SpriteBuilder& SpriteBuilder::SetProperty(const std::string& propertyName,
26 bool value) {
27 return *this;
28}
29
31 return *this;
32}
33
35 return *this;
36}
37
39 return *this;
40}
41
42SpriteBuilder& SpriteBuilder::AddFunction(const std::string& asmCode) {
43 return *this;
44}
45
46std::string SpriteBuilder::BuildProperties() const {
47 std::stringstream ss;
48 // Build the properties
49 for (int i = 0; i < 27; ++i) {
50 std::string property = "00";
51 if (!properties[i].empty())
52 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 {
92 return "";
93}
94
95// ============================================================================
96
98 int speed) {
99 SpriteInstruction instruction;
100
101 return instruction;
102}
103
105 SpriteInstruction instruction;
106 instruction.SetConfiguration("JSL Sprite_ApplySpeedTowardsPlayer");
107 return instruction;
108}
109
111 SpriteInstruction instruction;
112
113 return instruction;
114}
115
117 SpriteInstruction instruction;
118
119 return instruction;
120}
121
123 SpriteInstruction instruction;
124
125 return instruction;
126}
127
129 SpriteInstruction instruction;
130
131 return instruction;
132}
133
134SpriteInstruction SpriteInstruction::Custom(const std::string& asmCode) {
135 SpriteInstruction instruction;
136
137 return instruction;
138}
139
141 SpriteInstruction instruction;
142
143 return instruction;
144}
145
147 const std::string& functionName) {
148 SpriteInstruction instruction;
149
150 return instruction;
151}
152
153} // namespace zelda3
154} // namespace yaze
SpriteAction & AddInstruction(const SpriteInstruction &instruction)
std::string GetConfiguration() const
static SpriteAction Create()
SpriteAction & AddCustomInstruction(const std::string &asmCode)
SpriteAction & SetNextAction(const std::string &nextActionName)
std::string BuildProperties() const
SpriteBuilder & AddAction(const SpriteAction &action)
std::string Build() const
std::array< std::string, 27 > properties
SpriteBuilder & SetGlobalAction(const SpriteAction &action)
static SpriteBuilder Create(const std::string &spriteName)
SpriteBuilder & SetProperty(const std::string &propertyName, const std::string &value)
SpriteBuilder & AddFunction(const std::string &asmCode)
static SpriteInstruction JumpToFunction(const std::string &functionName)
static SpriteInstruction BehaveAsBarrier()
static SpriteInstruction BounceFromTileCollision()
static SpriteInstruction ApplySpeedTowardsPlayer(int speed)
void SetConfiguration(const std::string &instruction)
static SpriteInstruction SetTimer(int timerId, int value)
static SpriteInstruction PlayAnimation(int startFrame, int endFrame, int speed)
static SpriteInstruction MoveXyz()
static SpriteInstruction CheckDamageFromPlayer()
static SpriteInstruction Custom(const std::string &asmCode)
constexpr const char * kSpriteProperties[]