This repository has been archived by the owner on Nov 17, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Data Model
David Carver edited this page Nov 23, 2016
·
8 revisions
Here is a rough data model that can be used by the templates for the squads.
The data model is based on the XWSSpec. This is exposed to freemarker templates as the variable xwsspec. Please see the freemarker manual for more information on using the template language and building templates that can be used with XStreamer.
xwsspec
version - String
name - String - Squad name
points - Integer - Total Points for the Squad
faction - String - Faction Name
description - String - Description for the squadron
pilots - List<Pilot> - An List of Pilot objects, this makes up the squad.
##Pilots
*hull - Integer - Remaining Hull value for the ship.
*shields - Integer - Remaining Shields value for the ship
points - Integer - Point value for the ship including all upgrades
name - String - pilot name
*pilotId - String - Unique pilot identifier - useful for assigning values to generics
*pilotSkill - String - Skill level for the pilot.
ship - String - i.e. X-Wing, Tie Bomber, etc.
upgrades - Upgrades - contains the upgrades assigned to the pilot
Items marked with an * are additional items unique to XStreamer and not part of the official XWS Spec.
##Upgrades
additionalProperties - Map<String, List<String> - A key value pair of upgrade types and values.
Simple example of generating pilot information from a squad:
<#list xwsspec.pilots as pilot>
<div class="squad">
<b class="pilot">${pilot.name} (${pilot.points})</b><br/>
<b class="shields">${(pilot.shields)!"0"}</b> <image style="vertical-align: middle;" height="30" width="30" src="images/Token_Shield.png"/>
<b class="hull">${(pilot.hull)!"0"}</b><image style="vertical-align: middle;" height="30" width="30"src="images/Token_Hull.png"/>
<br/>
</div>
</#list>
The ship data is exposed as allships
variable. It is a List of Ship objects, that contain the actual data for a particular ship. This contains additional information beyond what is exposed in the XWSSpec.
actions - List<String> - a list of actions supported by the ship.
hull - Integer - hull value for the ship
shields - Integer - shield value for the ship.
agility - Integer - base agility value
attack - Integer - base attack value
faction - List<String> - a list of factions this ship belongs too.
maneuvers - List<List<Integer>> - a matrix of ship maneuvers
size - String - whether it is small, large, or huge.
xws - the name that xws has this, you can use this to cross reference from the the xwsspec variable.
energy - Integer - base energy value. Only valid for Huge ships.
epicpoints - Integer - how many epic points is the ship.
maneuversEnergy - List<List<Integer>> - matrix outlining the amount of energy recovered.
additionalProperties - Map<String, List<String>> - additional properties not covered above like crew, upgrades, etc.
To Do!