Is it possible to do something similar to the below? Currently when compiling it will throw an error saying that "Name has to refer to a struct, enum or contract". I also have a "working?" solution further below but I am unsure which would be the proper way.
mapping(address => uint256) shelf;
mapping (address => shelf) bookcase;
The idea being that an address would point to a bookcase which goes to a shelf which goes to an int (number of books).
The below works fine so far for setting the value for the shelf. The problem in this version is that I can not make bookcase public and can't figure out how to create a getter.
struct shelf
{
mapping(address => uint256) shelves;
}
mapping (address => shelves) bookcase;
bookcase[msg.sender] = shelf();
//shelf_address is argument from the function this code is in
bookcase[msg.sender].shelves[shelf_address] = 1;
Thanks for the pointers.