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.
XWS Root
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>