1234567891011121314151617181920212223242526272829303132333435 |
- /// <reference path="../ContentDescription.ts" />
- /// <reference path="CombatPokeUnit.ts" />
- /// <reference path="CombatUnit.ts" />
- /**
- * Quick Cheat Sheet of markers!
- */
- class CombatPokeDescription extends ContentDescription {
- public static DESCRIPTIONS = [];
- public constructor (name : string) {
- super(name, new ContentGroup());
- CombatPokeDescription.DESCRIPTIONS.push(this);
- }
- public setDescriptionFunction (descriptionFor : (target : any, markers : Array<any>) => Say) {
- let finalFunction = (description : CombatPokeDescription, group : ContentGroup) => {
- // Combat only has one unit
- let unit = <CombatPokeUnit> group.getUnit(0);
- return descriptionFor (unit.getTarget().nouns[0], unit.getMarkers());
- }
- this.description = finalFunction;
- return this;
- }
- public addUnit () {
- let unit = new CombatPokeUnit();
- (<ContentGroup> this.group).addUnit(unit);
- return unit;
- }
- public static getDescription (target : ContentGroup) {
- return ContentDescription.pickDescriptions(CombatPokeDescription.DESCRIPTIONS, target);
- }
- }
|