-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changing `getMachine` to be compatible with the runic matrix
- Loading branch information
1 parent
796dd14
commit adbb9e4
Showing
6 changed files
with
35 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
-- Import section | ||
|
||
local getMatrix = require("server.usecases.get-machine") | ||
|
||
-- | ||
|
||
local function exec(address) | ||
local matrix = getMatrix(address, nil, nil, require("server.entities.mocks.mock-matrix")) | ||
if not matrix.address then | ||
return {} | ||
end | ||
|
||
local aspects = matrix.getAspects().aspects | ||
local formattedAspects = {} | ||
if type(aspects) == "table" then | ||
for _, aspectTable in ipairs(aspects) do | ||
formattedAspects[aspectTable.name] = aspectTable.amount | ||
end | ||
end | ||
|
||
return formattedAspects | ||
end | ||
|
||
return exec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters