| 126 | } |
| 127 | |
| 128 | Json 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 | |
| 157 | void Particle::translate(Vec2F const& pos) { |
| 158 | position += pos; |
nothing calls this directly
no test coverage detected