Raindrops
  • 🛑!!! Deprecated !!!
  • Introduction (deprecated)
  • Description
    • Basic
    • Advanced
      • Game
      • Item
      • Player
      • Match
      • Staking
  • Quick Start
  • Concepts
    • Class Inheritance Structure
    • SFTs and Inexpensive Gaming
    • Inheritance
    • Propagation
    • Multiple Inheritance
    • Permissions
    • Propagation Permission
    • Namespaces
    • Indexing
  • Guides
    • Overview
    • Create an Item for NFT
  • Contracts
    • Overview
    • Item
      • Merklin'
      • State
      • Components
      • ItemUsages
      • Class Definition
      • Build
      • Item Activation
    • Player
      • Overview
    • Match
      • State
      • Life Cycle
      • Live Example
    • Namespace
      • Overview
    • Staking
      • Overview
Powered by GitBook
On this page
  1. Concepts

Namespaces

All raindrops artifacts that can be cached or assigned to a namespace have an identical first few fields.

Examples:

#[account]
pub struct Item {
    namespaces: Option<Vec<NamespaceAndIndex>>,
    // extra byte that is always 1 to simulate same structure as item class.
    padding: u8,
    parent: Pubkey,
...
}

#[account]
pub struct ItemClass {
    namespaces: Option<Vec<NamespaceAndIndex>>,
    parent: Option<Pubkey>,
...
}


#[account]
pub struct Player {
    namespaces: Option<Vec<NamespaceAndIndex>>,
    // extra byte that is always 1 to simulate same structure as item class.
    padding: u8,
    parent: Pubkey,

	...
}

#[account]
pub struct PlayerClass {
    namespaces: Option<Vec<NamespaceAndIndex>>,
    parent: Option<Pubkey>,
...
}

#[account]
pub struct Namespace {
    pub namespaces: Option<Vec<NamespaceAndIndex>>,
...
}

Note that even Namespace has a namespaces section that can be used to join it to other namespaces, making it composable. Any artifact can join a namespace if it has this optional array up front with available slots (defined and set on creation).

It is not required to have a namespace for your raindrops artifacts.

PreviousPropagation PermissionNextIndexing

Last updated 2 years ago

Joining a namespace is done through the .

namespace contract