brs-cr is a port of the Brickadia brs save (de)serializer.
Only supports versions 4+.
-
Add the dependency to your
shard.yml
:dependencies: brs-cr: github: voximity/brs-cr
-
Run
shards install
This will create the file out.brs
with a 16x16 grid of randomly colored 1x1f bricks.
require "brs-cr"
me = BRS::User.new(username: "x", uuid: UUID.new("3f5108a0-c929-4e77-a115-21f65096887b"))
save = BRS::Save.new(
author: me,
description: "generated save file"
)
16.times do |y|
16.times do |x|
save.bricks << BRS::Brick.new(
size: BRS::UVector3.new(5, 5, 2),
position: BRS::Vector3.new(5 + x * 10, 5 + y * 10, 2),
color_index: Random.rand(0...save.colors.size)
)
end
end
save.write(File.new("input/out.brs", mode: "w"))
- Fork it (https://github.com/voximity/brs-cr/fork)
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request