MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / toJson

Method toJson

source/game/StarParticle.cpp:128–155  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

126}
127
128Json Particle::toJson() const {
129 return JsonObject{{"type", TypeNames.getRight(type)},
130 {"size", size},
131 {"string", string},
132 {"color", jsonFromColor(color)},
133 {"light", jsonFromColor(light)},
134 {"fade", fade},
135 {"fullbright", fullbright},
136 {"position", jsonFromVec2F(position)},
137 {"velocity", jsonFromVec2F(velocity)},
138 {"finalVelocity", jsonFromVec2F(finalVelocity)},
139 {"approach", jsonFromVec2F(approach)},
140 {"flip", flip},
141 {"flippable", flippable},
142 {"rotation", rotation * 180.0f / Constants::pi},
143 {"angularVelocity", angularVelocity * 180.0f / Constants::pi},
144 {"length", length},
145 {"destructionAction", DestructionActionNames.getRight(destructionAction)},
146 {"destructionImage", AssetPath::join(destructionImage)},
147 {"destructionTime", destructionTime},
148 {"timeToLive", timeToLive},
149 {"layer", LayerNames.getRight(layer)},
150 {"collidesForeground", collidesForeground},
151 {"collidesLiquid", collidesLiquid},
152 {"underwaterOnly", underwaterOnly},
153 {"ignoreWind", ignoreWind},
154 {"trail", trail}};
155}
156
157void Particle::translate(Vec2F const& pos) {
158 position += pos;

Callers

nothing calls this directly

Calls 3

jsonFromColorFunction · 0.85
jsonFromVec2FFunction · 0.85
joinFunction · 0.50

Tested by

no test coverage detected