portal_figure 0.1.1

A library of data relating to figures from the Skylanders series of video games.
Documentation
  • Coverage
  • 0%
    0 out of 460 items documented0 out of 2 items with examples
  • Size
  • Source code size: 74.9 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.9 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 8s Average build duration of successful builds.
  • all releases: 11s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • peabnuts123

portal_figure

A library of data relating to figures from the Skylanders series of video games.

This crate is built from source: https://github.com/peabnuts123/libportalfigure

Installation

cargo add portal_figure

Usage

use portal_figure::{PORTAL_FIGURES, PortalFigure, SPYRO, find_figure};

fn main() {
    // Use `find_figure()` to look up figure data by Figure ID + Variant ID
    let figure: &PortalFigure = find_figure(0x1ce, 0x3000).expect("Couldn't find figure");
    println!(
        "{} (figure_id='0x{:x}') (variant_id='0x{:x}')",
        figure.name, figure.figure_id, figure.variant_id
    );

    // Individually exported figure data
    println!(
        "Spyro (figure_id='0x{:x}') (variant_id='0x{:x}')",
        SPYRO.figure_id, SPYRO.variant_id
    );

    // `PORTAL_FIGURES` is a &[PortalFigure] of all figures
    let all_spyros = PORTAL_FIGURES
        .iter()
        .filter(|figure| figure.name.to_lowercase().contains("spyro"))
        .collect::<Vec<&PortalFigure>>();

    println!("All Spyro figures:");
    for figure in all_spyros {
        println!(
            "{} (figure_id='0x{:x}') (variant_id='0x{:x}')",
            figure.name, figure.figure_id, figure.variant_id
        );
    }
}