brs-cr
brs-cr
brs-cr is a port of the Brickadia brs save (de)serializer.
Only supports versions 4+.
Installation
-
Add the dependency to your
shard.yml
:dependencies: brs-cr: github: voximity/brs-cr
-
Run
shards install
Usage
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"))
Contributing
- 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
Credits
Repository
brs-cr
Owner
Statistic
- 0
- 1
- 1
- 2
- 0
- about 4 years ago
- May 11, 2020
License
MIT License
Links
Synced at
Fri, 22 Nov 2024 08:11:05 GMT
Languages