Code Monkey home page Code Monkey logo

saphire-types's Introduction

Saphire-types

This crate is part of the saphire project. For more information see Saphire-rs.

The goal of Saphire-types is to provide rust types for serializing and deserializing Diamondfire templates. To get started simply create a new Template and add any number of code blocks, than .compile() it.

use saphire-types::{
    block::{Block as B,
        prelude::*
    }
    template::Template,
    targets::PlayerTarget,
    types::*
}

fn main() -> () {
    // A simple template that sends a message to all players when a player joins.
    let template = Template::new("simple_join".to_string(), vec![
        B::PlayerEvent {
            event: PlayerEvent::PlayerJoinGameEvent {}
        },
        B::PlayerAction {
            action: PlayerAction::SendMessage {
                message_to_send:vec![MiniMessage::Literal(MiniMessageLiteral::new("Hello World".to_string()))],
                alignment_mode_tag: Default::default(),
                inherit_styles_tag: Default::default(),
                text_value_merging_tag: Default::default(),
        },
            target: PlayerTarget::All
        },
    ]);

    println!("{}", template.compile());
}

Contributing

Any and all help on this project is welcome, but if you want your contributions dealt with faster making sure that they are well formated and documented helps. It is also important to remember that large portions of this crate are auto-generated using Saphire-typegen, so changes to any auto-generated modules should be made there.

saphire-types's People

Contributors

puzzleoxide avatar

Watchers

 avatar

saphire-types's Issues

Template serialization and deserialization support

Currently saphire-types does not support serde serialization or deserialization. This must be manually implemented and relies heavily on saphire-typegen providing compilation functions for it's generated modules.

Checklist

  • saphire-typegen support
  • serializer support
  • deserializer support

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.