mirror of
https://github.com/exane/not-gwent-online
synced 2024-11-23 19:36:53 +00:00
4108 lines
357 KiB
JavaScript
4108 lines
357 KiB
JavaScript
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.app = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
|
||
"use strict";
|
||
|
||
module.exports = {
|
||
|
||
"agile": {
|
||
cancelPlacement: true,
|
||
onBeforePlace: function onBeforePlace(card) {
|
||
var self = this;
|
||
this.send("played:agile", { cardID: card.getID() }, true);
|
||
this.on("agile:setField", function (type) {
|
||
self.off("agile:setField");
|
||
card.changeType(type);
|
||
self.placeCard(card, {
|
||
disabled: true
|
||
});
|
||
self.hand.remove(card);
|
||
});
|
||
}
|
||
},
|
||
"medic": {
|
||
waitResponse: true,
|
||
onAfterPlace: function onAfterPlace(card) {
|
||
var discard = this.getDiscard();
|
||
|
||
discard = this.filter(discard, {
|
||
"ability": "hero",
|
||
"type": card.constructor.TYPE.SPECIAL
|
||
});
|
||
|
||
this.send("played:medic", {
|
||
cards: JSON.stringify(discard)
|
||
}, true);
|
||
}
|
||
},
|
||
"morale_boost": {
|
||
|
||
onEachCardPlace: function onEachCardPlace(card) {
|
||
var field = this.field[card.getType()];
|
||
var id = card.getID();
|
||
if (!field.isOnField(card)) {
|
||
field.get().forEach(function (_card) {
|
||
if (_card.getID() == id) return;
|
||
if (_card.getType() != card.getType()) return;
|
||
_card.setBoost(id, 0);
|
||
});
|
||
/*this.off("EachCardPlace")*/
|
||
this.off("EachCardPlace", card.getUidEvents("EachCardPlace"));
|
||
return;
|
||
}
|
||
|
||
field.get().forEach(function (_card) {
|
||
if (_card.getID() == id) return;
|
||
if (_card.getType() != card.getType()) return;
|
||
_card.setBoost(id, 1);
|
||
});
|
||
}
|
||
},
|
||
"muster": {
|
||
name: "muster",
|
||
onAfterPlace: function onAfterPlace(card) {
|
||
var musterType = card.getMusterType();
|
||
var self = this;
|
||
|
||
var cardsDeck = this.deck.find("musterType", musterType);
|
||
var cardsHand = this.hand.find("musterType", musterType);
|
||
|
||
cardsDeck.forEach(function (_card) {
|
||
self.deck.removeFromDeck(_card);
|
||
self.placeCard(_card, {
|
||
suppress: "muster"
|
||
});
|
||
});
|
||
cardsHand.forEach(function (_card) {
|
||
self.hand.remove(_card);
|
||
self.placeCard(_card, {
|
||
suppress: "muster"
|
||
});
|
||
});
|
||
}
|
||
},
|
||
"tight_bond": {
|
||
onAfterPlace: function onAfterPlace(card) {
|
||
var field = this.field[card.getType()];
|
||
var cards = field.get();
|
||
var lastInsert = cards.length;
|
||
|
||
if (lastInsert < 2) return;
|
||
|
||
if (cards[lastInsert - 2].getName() == cards[lastInsert - 1].getName()) {
|
||
cards[lastInsert - 2].boost(+cards[lastInsert - 2].getPower());
|
||
cards[lastInsert - 1].boost(+cards[lastInsert - 1].getPower());
|
||
}
|
||
}
|
||
},
|
||
"spy": {
|
||
changeSide: true,
|
||
onAfterPlace: function onAfterPlace(card) {
|
||
this.draw(2);
|
||
}
|
||
},
|
||
"weather_fog": {
|
||
onEachTurn: function onEachTurn(card) {
|
||
var targetRow = card.constructor.TYPE.RANGED;
|
||
var forcedPower = 1;
|
||
var field1 = this.field[targetRow].get();
|
||
var field2 = this.foe.field[targetRow].get();
|
||
|
||
var field = field1.concat(field2);
|
||
|
||
field.forEach(function (_card) {
|
||
if (_card.getRawAbility() == "hero") return;
|
||
_card.setForcedPower(forcedPower);
|
||
});
|
||
},
|
||
onEachCardPlace: function onEachCardPlace(card) {
|
||
var targetRow = card.constructor.TYPE.RANGED;
|
||
var forcedPower = 1;
|
||
var field1 = this.field[targetRow].get();
|
||
var field2 = this.foe.field[targetRow].get();
|
||
|
||
var field = field1.concat(field2);
|
||
|
||
field.forEach(function (_card) {
|
||
if (_card.getRawAbility() == "hero") return;
|
||
_card.setForcedPower(forcedPower);
|
||
});
|
||
}
|
||
},
|
||
"weather_rain": {
|
||
onEachTurn: function onEachTurn(card) {
|
||
var targetRow = card.constructor.TYPE.SIEGE;
|
||
var forcedPower = 1;
|
||
var field1 = this.field[targetRow].get();
|
||
var field2 = this.foe.field[targetRow].get();
|
||
|
||
var field = field1.concat(field2);
|
||
|
||
field.forEach(function (_card) {
|
||
if (_card.getRawAbility() == "hero") return;
|
||
_card.setForcedPower(forcedPower);
|
||
});
|
||
}
|
||
},
|
||
"weather_frost": {
|
||
onEachTurn: function onEachTurn(card) {
|
||
var targetRow = card.constructor.TYPE.CLOSE_COMBAT;
|
||
var forcedPower = 1;
|
||
var field1 = this.field[targetRow].get();
|
||
var field2 = this.foe.field[targetRow].get();
|
||
|
||
var field = field1.concat(field2);
|
||
|
||
field.forEach(function (_card) {
|
||
if (_card.getRawAbility() == "hero") return;
|
||
_card.setForcedPower(forcedPower);
|
||
});
|
||
}
|
||
},
|
||
"clear_weather": {
|
||
onAfterPlace: function onAfterPlace(card) {
|
||
var targetRow = card.constructor.TYPE.WEATHER;
|
||
var field = this.field[targetRow].get();
|
||
|
||
//todo: remove weather cards
|
||
}
|
||
},
|
||
"decoy": {
|
||
replaceWith: true
|
||
},
|
||
"foltest_leader1": {
|
||
onActivate: function onActivate() {
|
||
var cards = this.deck.find("key", "impenetrable_fog");
|
||
if (!cards.length) return;
|
||
var card = this.deck.removeFromDeck(cards[0]);
|
||
this.placeCard(card);
|
||
}
|
||
},
|
||
"francesca_leader1": {},
|
||
"francesca_leader2": {},
|
||
"francesca_leader3": {},
|
||
"francesca_leader4": {},
|
||
"eredin_leader1": {},
|
||
"eredin_leader2": {},
|
||
"eredin_leader3": {},
|
||
"eredin_leader4": {},
|
||
"hero": {}
|
||
};
|
||
|
||
},{}],2:[function(require,module,exports){
|
||
/**
|
||
* types
|
||
* 0 close combat
|
||
* 1 ranged
|
||
* 2 siege
|
||
* 3 leader
|
||
* 4 special (decoy)
|
||
* 5 weather
|
||
*/
|
||
|
||
"use strict";
|
||
|
||
module.exports = {
|
||
"redanian_foot_soldier": {
|
||
name: "Redanian Foot Soldier",
|
||
power: 1,
|
||
ability: null,
|
||
img: "foot_soldier1",
|
||
faction: "Northern Realm",
|
||
type: 0
|
||
},
|
||
"poor_fucking_infantry": {
|
||
name: "Poor Fucking Infantry",
|
||
power: 1,
|
||
ability: "tight_bond",
|
||
img: "infantry",
|
||
faction: "Northern Realm",
|
||
type: 0
|
||
},
|
||
"yarpen_zigrin": {
|
||
name: "Yarpen Zigrin",
|
||
power: 2,
|
||
ability: null,
|
||
img: "yarpen",
|
||
faction: "Northern Realm",
|
||
type: 0
|
||
},
|
||
"blue_stripes_commando": {
|
||
name: "Blue Stripes Commando",
|
||
power: 4,
|
||
ability: "tight_bond",
|
||
img: "commando",
|
||
faction: "Northern Realm",
|
||
type: 0
|
||
},
|
||
"sigismunt_dijkstra": {
|
||
name: "Sigismunt Dijkstra",
|
||
power: 4,
|
||
ability: "spy",
|
||
img: "dijkstra",
|
||
faction: "Northern Realm",
|
||
type: 0
|
||
},
|
||
"prince_stennis": {
|
||
name: "Prince Stennis",
|
||
power: 5,
|
||
ability: "spy",
|
||
img: "stennis",
|
||
faction: "Northern Realm",
|
||
type: 0
|
||
},
|
||
"siegfried_of_denesle": {
|
||
name: "Siegfried of Denesle",
|
||
power: 5,
|
||
ability: null,
|
||
img: "siegfried",
|
||
faction: "Northern Realm",
|
||
type: 0
|
||
},
|
||
"ves": {
|
||
name: "Ves",
|
||
power: 5,
|
||
ability: null,
|
||
img: "ves",
|
||
faction: "Northern Realm",
|
||
type: 0
|
||
},
|
||
"vernon_roche": {
|
||
name: "Vernon Roche",
|
||
power: 10,
|
||
ability: "hero",
|
||
img: "roche",
|
||
faction: "Northern Realm",
|
||
type: 0
|
||
},
|
||
"john_natalis": {
|
||
name: "John Natalis",
|
||
power: 10,
|
||
ability: "hero",
|
||
img: "natalis",
|
||
faction: "Northern Realm",
|
||
type: 0
|
||
},
|
||
"sheldon_skaggs": {
|
||
name: "Sheldon Skaggs",
|
||
power: 4,
|
||
ability: null,
|
||
img: "skaggs",
|
||
faction: "Northern Realm",
|
||
type: 1
|
||
},
|
||
"sabrina_glevissig": {
|
||
name: "Sabrina Glevissig",
|
||
power: 4,
|
||
ability: null,
|
||
img: "sabrina",
|
||
faction: "Northern Realm",
|
||
type: 1
|
||
},
|
||
"crinfrid_reavers_dragon_hunter": {
|
||
name: "Crinfrid Reaver's Dragon Hunter",
|
||
power: 5,
|
||
ability: "tight_bond",
|
||
img: "crinfrid",
|
||
faction: "Northern Realm",
|
||
type: 1
|
||
},
|
||
"sile_de_tansarville": {
|
||
name: "Síle de Tansarville",
|
||
power: 5,
|
||
ability: null,
|
||
img: "sile",
|
||
faction: "Northern Realm",
|
||
type: 1
|
||
},
|
||
"keira_metz": {
|
||
name: "Keira Metz",
|
||
power: 5,
|
||
ability: null,
|
||
img: "keira",
|
||
faction: "Northern Realm",
|
||
type: 1
|
||
},
|
||
"dethmold": {
|
||
name: "Dethmold",
|
||
power: 6,
|
||
ability: null,
|
||
img: "dethmold",
|
||
faction: "Northern Realm",
|
||
type: 1
|
||
},
|
||
"kaedweni_siege_expert": {
|
||
name: "Kaedweni Siege Expert",
|
||
power: 1,
|
||
ability: "morale_boost",
|
||
img: "siege_expert1",
|
||
faction: "Northern Realm",
|
||
type: 2
|
||
},
|
||
"dun_banner_medic": {
|
||
name: "Dun Banner Medic",
|
||
power: 5,
|
||
ability: "medic",
|
||
img: "medic",
|
||
faction: "Northern Realm",
|
||
type: 2
|
||
},
|
||
"ballista": {
|
||
name: "Ballista",
|
||
power: 6,
|
||
ability: null,
|
||
img: "ballista1",
|
||
faction: "Northern Realm",
|
||
type: 2
|
||
},
|
||
"trebuchet": {
|
||
name: "Trebuchet",
|
||
power: 6,
|
||
ability: null,
|
||
img: "trebuchet1",
|
||
faction: "Northern Realm",
|
||
type: 2
|
||
},
|
||
"thaler": {
|
||
name: "Thaler",
|
||
power: 1,
|
||
ability: "spy",
|
||
img: "thaler",
|
||
faction: "Northern Realm",
|
||
type: 2
|
||
},
|
||
"foltest_king_of_temeria": {
|
||
name: "Foltest: King of Temeria",
|
||
power: -1,
|
||
ability: "foltest_leader1",
|
||
img: "foltest_king",
|
||
faction: "Northern Realm",
|
||
type: 3
|
||
},
|
||
"decoy": {
|
||
name: "Decoy",
|
||
power: -1,
|
||
ability: "decoy",
|
||
img: "decoy",
|
||
faction: null,
|
||
type: 4
|
||
},
|
||
"impenetrable_fog": {
|
||
name: "Impenetrable Fog",
|
||
power: -1,
|
||
ability: "weather_fog",
|
||
img: "fog",
|
||
faction: null,
|
||
type: 5
|
||
},
|
||
|
||
"francesca_pureblood_elf": {
|
||
name: "Francesca, Pureblood Elf",
|
||
power: -1,
|
||
ability: "francesca_leader1",
|
||
img: "francesca_pureblood",
|
||
faction: "Scoia'tael",
|
||
type: 3
|
||
},
|
||
"francesca_the_beautiful": {
|
||
name: "Francesca The Beautiful",
|
||
power: -1,
|
||
ability: "francesca_leader2",
|
||
img: "francesca_beatiful",
|
||
faction: "Scoia'tael",
|
||
type: 3
|
||
},
|
||
"francesca_daisy_of_the_valley": {
|
||
name: "Francesca, Daisy of The Valley",
|
||
power: -1,
|
||
ability: "francesca_leader3",
|
||
img: "francesca_daisy",
|
||
faction: "Scoia'tael",
|
||
type: 3
|
||
},
|
||
"francesca_queen_of_dol_blathanna": {
|
||
name: "Francesca, Queen of Dol Blathanna",
|
||
power: -1,
|
||
ability: "francesca_leader4",
|
||
img: "francesca_queen",
|
||
faction: "Scoia'tael",
|
||
type: 3
|
||
},
|
||
"saesenthessis": {
|
||
name: "Saesenthessis",
|
||
power: 10,
|
||
ability: "hero",
|
||
img: "saesenthessis",
|
||
faction: "Scoia'tael",
|
||
type: 1
|
||
},
|
||
"iorveth": {
|
||
name: "Iorveth",
|
||
power: 10,
|
||
ability: "hero",
|
||
img: "iorveth",
|
||
faction: "Scoia'tael",
|
||
type: 1
|
||
},
|
||
"isengrim_faoiltiarnah": {
|
||
name: "Isengrim Faoiltiarnah",
|
||
power: 10,
|
||
ability: ["hero", "morale_boost"],
|
||
img: "isengrim",
|
||
faction: "Scoia'tael",
|
||
type: 0
|
||
},
|
||
"eithne": {
|
||
name: "Eithne",
|
||
power: 10,
|
||
ability: "hero",
|
||
img: "eithne",
|
||
faction: "Scoia'tael",
|
||
type: 1
|
||
},
|
||
"havekar_healer": {
|
||
name: "Havekar Healer",
|
||
power: 0,
|
||
ability: "medic",
|
||
img: "healer",
|
||
faction: "Scoia'tael",
|
||
type: 1
|
||
},
|
||
"riordain": {
|
||
name: "Riordain",
|
||
power: 1,
|
||
ability: null,
|
||
img: "riordain",
|
||
faction: "Scoia'tael",
|
||
type: 1
|
||
},
|
||
"toruviel": {
|
||
name: "Toruviel",
|
||
power: 2,
|
||
ability: null,
|
||
img: "toruviel",
|
||
faction: "Scoia'tael",
|
||
type: 1
|
||
},
|
||
"elven_skirmisher": {
|
||
name: "Elven Skirmisher",
|
||
power: 2,
|
||
ability: "muster",
|
||
musterType: "skirmisher",
|
||
img: "elven_skirmisher2",
|
||
faction: "Scoia'tael",
|
||
type: 1
|
||
},
|
||
"dwarven_skirmisher": {
|
||
name: "Dwarven Skirmisher",
|
||
power: 3,
|
||
ability: "muster",
|
||
musterType: "skirmisher",
|
||
img: "skirmisher2",
|
||
faction: "Scoia'tael",
|
||
type: 0
|
||
},
|
||
"ciaran_aep_easnillien": {
|
||
name: "Ciaran aep Easnillien",
|
||
power: 3,
|
||
ability: "agile",
|
||
img: "easnillien",
|
||
faction: "Scoia'tael",
|
||
type: 1
|
||
},
|
||
"vrihedd_brigade_recruit": {
|
||
name: "Vrihedd Brigade Recruit",
|
||
power: 4,
|
||
ability: null,
|
||
img: "recruit",
|
||
faction: "Scoia'tael",
|
||
type: 1
|
||
},
|
||
"dol_blathanna_archer": {
|
||
name: "Dol Blathanna Archer",
|
||
power: 4,
|
||
ability: null,
|
||
img: "archer",
|
||
faction: "Scoia'tael",
|
||
type: 1
|
||
}, /*
|
||
"hav_caaren_medic": {
|
||
name: "Hav’caaren Medic",
|
||
power: 5,
|
||
ability: null,
|
||
img: "", //missing image
|
||
faction: "Scoia'tael",
|
||
type: 0
|
||
},*/
|
||
"havekar_smuggler": {
|
||
name: "Havekar Smuggler",
|
||
power: 5,
|
||
ability: "spy",
|
||
img: "smuggler1",
|
||
faction: "Scoia'tael",
|
||
type: 0
|
||
},
|
||
"mahakaman_defender": {
|
||
name: "Mahakaman Defender",
|
||
power: 5,
|
||
ability: null,
|
||
img: "defender2",
|
||
faction: "Scoia'tael",
|
||
type: 0
|
||
},
|
||
"vrihedd_brigade_veteran": {
|
||
name: "Vrihedd Brigade Veteran",
|
||
power: 5,
|
||
ability: "agile",
|
||
img: "veteran1",
|
||
faction: "Scoia'tael",
|
||
type: 0
|
||
},
|
||
"dennis_cranmer": {
|
||
name: "Dennis Cranmer",
|
||
power: 6,
|
||
ability: null,
|
||
img: "cranmer",
|
||
faction: "Scoia'tael",
|
||
type: 0
|
||
},
|
||
"filavandrel_aen_fidhail": {
|
||
name: "Filavandrel aén Fidháil",
|
||
power: 6,
|
||
ability: "agile",
|
||
img: "fidhail",
|
||
faction: "Scoia'tael",
|
||
type: 1
|
||
},
|
||
"ida_emean_aep_sivney": {
|
||
name: "Ida Emean aep Sivney",
|
||
power: 6,
|
||
ability: null,
|
||
img: "sivney",
|
||
faction: "Scoia'tael",
|
||
type: 1
|
||
},
|
||
"yaevinn": {
|
||
name: "Yaevinn",
|
||
power: 6,
|
||
ability: "agile",
|
||
img: "yaevinn",
|
||
faction: "Scoia'tael",
|
||
type: 0
|
||
},
|
||
"barclay_els": {
|
||
name: "Barclay Els",
|
||
power: 6,
|
||
ability: "agile",
|
||
img: "barclay",
|
||
faction: "Scoia'tael",
|
||
type: 0
|
||
},
|
||
"dol_blathanna_scout": {
|
||
name: "Dol Blathanna Scout",
|
||
power: 6,
|
||
ability: "agile",
|
||
img: "scout2",
|
||
faction: "Scoia'tael",
|
||
type: 0
|
||
},
|
||
"milva": {
|
||
name: "Milva",
|
||
power: 10,
|
||
ability: "morale_boost",
|
||
img: "milva",
|
||
faction: "Scoia'tael",
|
||
type: 1
|
||
},
|
||
|
||
"eredin_commander_of_the_red_riders": {
|
||
name: "Eredin, Commander of the Red Riders",
|
||
power: -1,
|
||
ability: "eredin_leader1",
|
||
img: "eredin_commander",
|
||
faction: "monster",
|
||
type: 3
|
||
},
|
||
"eredin_bringer_of_death": {
|
||
name: "Eredin, Bringer of Death",
|
||
power: -1,
|
||
ability: "eredin_leader2",
|
||
img: "eredin_bringer",
|
||
faction: "monster",
|
||
type: 3
|
||
},
|
||
"eredin_destroyer_of_worlds": {
|
||
name: "Eredin, Destroyer of Worlds",
|
||
power: -1,
|
||
ability: "eredin_leader3",
|
||
img: "eredin_destroyer",
|
||
faction: "monster",
|
||
type: 3
|
||
},
|
||
"eredin_king_of_the_wild_hunt": {
|
||
name: "Eredin, King of The Wild Hunt",
|
||
power: -1,
|
||
ability: "eredin_leader4",
|
||
img: "eredin_king",
|
||
faction: "monster",
|
||
type: 3
|
||
},
|
||
"kayran": {
|
||
name: "Kayran",
|
||
power: 8,
|
||
ability: ["hero", "morale_boost"],
|
||
img: "kayran",
|
||
faction: "monster",
|
||
type: 1
|
||
},
|
||
"leshen": {
|
||
name: "Leshen",
|
||
power: 10,
|
||
ability: "hero",
|
||
img: "leshen",
|
||
faction: "monster",
|
||
type: 1
|
||
},
|
||
"imlerith": {
|
||
name: "Imlerith",
|
||
power: 10,
|
||
ability: "hero",
|
||
img: "imlerith",
|
||
faction: "monster",
|
||
type: 0
|
||
},
|
||
"draug": {
|
||
name: "Draug",
|
||
power: 10,
|
||
ability: "hero",
|
||
img: "draug",
|
||
faction: "monster",
|
||
type: 0
|
||
},
|
||
"ghoul": {
|
||
name: "Ghoul",
|
||
power: 1,
|
||
ability: "muster",
|
||
musterType: "ghoul",
|
||
img: "ghoul1",
|
||
faction: "monster",
|
||
type: 0
|
||
},
|
||
"nekker": {
|
||
name: "Nekker",
|
||
power: 2,
|
||
ability: "muster",
|
||
musterType: "nekker",
|
||
img: "nekker",
|
||
faction: "monster",
|
||
type: 0
|
||
},
|
||
"wyvern": {
|
||
name: "Wyvern",
|
||
power: 2,
|
||
ability: null,
|
||
img: "wyvern",
|
||
faction: "monster",
|
||
type: 1
|
||
},
|
||
"foglet": {
|
||
name: "Foglet",
|
||
power: 2,
|
||
ability: null,
|
||
img: "foglet",
|
||
faction: "monster",
|
||
type: 0
|
||
},
|
||
"celaeno_harpy": {
|
||
name: "Celaeno Harpy",
|
||
power: 2,
|
||
ability: null,
|
||
img: "celaeno_harpy",
|
||
faction: "monster",
|
||
type: 1
|
||
},
|
||
"gargoyle": {
|
||
name: "Gargoyle",
|
||
power: 2,
|
||
ability: null,
|
||
img: "gargoyle",
|
||
faction: "monster",
|
||
type: 1
|
||
},
|
||
"cockatrice": {
|
||
name: "Cockatrice",
|
||
power: 2,
|
||
ability: null,
|
||
img: "cockatrice",
|
||
faction: "monster",
|
||
type: 1
|
||
},
|
||
"harpy": {
|
||
name: "Harpy",
|
||
power: 2,
|
||
ability: "agile",
|
||
img: "harpy",
|
||
faction: "monster",
|
||
type: 1
|
||
},
|
||
"endrega": {
|
||
name: "Endrega",
|
||
power: 2,
|
||
ability: null,
|
||
img: "endrega",
|
||
faction: "monster",
|
||
type: 1
|
||
},
|
||
"vampire_bruxa": {
|
||
name: "Vampire: Bruxa",
|
||
power: 4,
|
||
ability: "muster",
|
||
musterType: "vampire",
|
||
img: "vampire_bruxa",
|
||
faction: "monster",
|
||
type: 0
|
||
},
|
||
"vampire_fleder": {
|
||
name: "Vampire: Fleder",
|
||
power: 4,
|
||
ability: "muster",
|
||
musterType: "vampire",
|
||
img: "vampire_fleder",
|
||
faction: "monster",
|
||
type: 0
|
||
},
|
||
"vampire_garkain": {
|
||
name: "Vampire: Garkain",
|
||
power: 4,
|
||
ability: "muster",
|
||
musterType: "vampire",
|
||
img: "vampire_garkain",
|
||
faction: "monster",
|
||
type: 0
|
||
},
|
||
"vampire_ekimmara": {
|
||
name: "Vampire: Ekimmara",
|
||
power: 4,
|
||
ability: "muster",
|
||
musterType: "vampire",
|
||
img: "vampire_ekimmara",
|
||
faction: "monster",
|
||
type: 0
|
||
},
|
||
"arachas": {
|
||
name: "Arachas",
|
||
power: 4,
|
||
ability: "muster",
|
||
musterType: "arachas",
|
||
img: "arachas1",
|
||
faction: "monster",
|
||
type: 0
|
||
},
|
||
"botchling": {
|
||
name: "Botchling",
|
||
power: 4,
|
||
ability: null,
|
||
img: "botchling",
|
||
faction: "monster",
|
||
type: 0
|
||
},
|
||
"forktail": {
|
||
name: "Forktail",
|
||
power: 5,
|
||
ability: null,
|
||
img: "forktail",
|
||
faction: "monster",
|
||
type: 0
|
||
},
|
||
"plague_maiden": {
|
||
name: "Plague Maiden",
|
||
power: 5,
|
||
ability: null,
|
||
img: "forktail",
|
||
faction: "monster",
|
||
type: 0
|
||
},
|
||
"griffin": {
|
||
name: "Griffin",
|
||
power: 5,
|
||
ability: null,
|
||
img: "griffin",
|
||
faction: "monster",
|
||
type: 0
|
||
},
|
||
"werewolf": {
|
||
name: "Werewolf",
|
||
power: 5,
|
||
ability: null,
|
||
img: "werewolf",
|
||
faction: "monster",
|
||
type: 0
|
||
},
|
||
"frightener": {
|
||
name: "Frightener",
|
||
power: 5,
|
||
ability: null,
|
||
img: "frightener",
|
||
faction: "monster",
|
||
type: 0
|
||
},
|
||
"ice_giant": {
|
||
name: "Ice Giant",
|
||
power: 5,
|
||
ability: null,
|
||
img: "ice_giant",
|
||
faction: "monster",
|
||
type: 2
|
||
},
|
||
"grave_hag": {
|
||
name: "Grave Hag",
|
||
power: 5,
|
||
ability: null,
|
||
img: "grave_hag",
|
||
faction: "monster",
|
||
type: 1
|
||
},
|
||
/*"vampire_katakan": {
|
||
name: "Vampire: Katakan",
|
||
power: 5,
|
||
ability: "muster",
|
||
musterType: "vampire",
|
||
img: "vampire_katakan",
|
||
faction: "monster",
|
||
type: 0
|
||
},*/
|
||
"crone_whispess": {
|
||
name: "Crone: Whispess",
|
||
power: 6,
|
||
ability: "muster",
|
||
musterType: "crone",
|
||
img: "crone_whispess",
|
||
faction: "monster",
|
||
type: 0
|
||
},
|
||
"crone_brewess": {
|
||
name: "Crone: Brewess",
|
||
power: 6,
|
||
ability: "muster",
|
||
musterType: "crone",
|
||
img: "crone_brewess",
|
||
faction: "monster",
|
||
type: 0
|
||
},
|
||
"crone_weavess": {
|
||
name: "Crone: Weavess",
|
||
power: 6,
|
||
ability: "muster",
|
||
musterType: "crone",
|
||
img: "crone_weavess",
|
||
faction: "monster",
|
||
type: 0
|
||
},
|
||
"arachas_behemoth": {
|
||
name: "Arachas Behemoth",
|
||
power: 6,
|
||
ability: "muster",
|
||
musterType: "arachas",
|
||
img: "arachas_behemoth",
|
||
faction: "monster",
|
||
type: 2
|
||
},
|
||
"fire_elemental": {
|
||
name: "Fire Elemental",
|
||
power: 6,
|
||
ability: null,
|
||
img: "fire_elemental",
|
||
faction: "monster",
|
||
type: 2
|
||
},
|
||
"fiend": {
|
||
name: "Fiend",
|
||
power: 6,
|
||
ability: null,
|
||
img: "fiend",
|
||
faction: "monster",
|
||
type: 0
|
||
},
|
||
"earth_elemental": {
|
||
name: "Earth Elemental",
|
||
power: 6,
|
||
ability: null,
|
||
img: "earth_elemental",
|
||
faction: "monster",
|
||
type: 2
|
||
}
|
||
};
|
||
|
||
},{}],3:[function(require,module,exports){
|
||
"use strict";
|
||
|
||
module.exports = {
|
||
|
||
"northern_realm": ["redanian_foot_soldier", "poor_fucking_infantry", "redanian_foot_soldier", "poor_fucking_infantry", "yarpen_zigrin", "blue_stripes_commando", "sigismunt_dijkstra", "prince_stennis", "siegfried_of_denesle", "ves", "vernon_roche", "john_natalis", "sheldon_skaggs", "sabrina_glevissig", "crinfrid_reavers_dragon_hunter", "sile_de_tansarville", "keira_metz", "dethmold", "kaedweni_siege_expert", "dun_banner_medic", "ballista", "trebuchet", "thaler", "foltest_king_of_temeria", "decoy", "impenetrable_fog"],
|
||
|
||
"scoiatael": ["francesca_daisy_of_the_valley", "saesenthessis", "iorveth", "isengrim_faoiltiarnah", "eithne", "havekar_healer", "riordain", "toruviel", "decoy", "decoy", "impenetrable_fog", "elven_skirmisher", "elven_skirmisher", "dwarven_skirmisher", "dwarven_skirmisher", "ciaran_aep_easnillien", "vrihedd_brigade_recruit", "dol_blathanna_archer", "havekar_smuggler", "mahakaman_defender", "vrihedd_brigade_veteran", "dennis_cranmer", "filavandrel_aen_fidhail", "filavandrel_aen_fidhail", "ida_emean_aep_sivney", "yaevinn", "barclay_els", "dol_blathanna_scout", "milva"],
|
||
|
||
"monster": ["eredin_king_of_the_wild_hunt", "kayran", "leshen", "imlerith", "draug", "ghoul", "decoy", "decoy", "nekker", "nekker", "wyvern", "foglet", "celaeno_harpy", "gargoyle", "cockatrice", "harpy", "impenetrable_fog", "endrega", "vampire_bruxa", "vampire_bruxa", "vampire_fleder", "vampire_fleder", "vampire_garkain", "vampire_garkain", "vampire_ekimmara", "vampire_ekimmara", "arachas", "botchling", "forktail", "plague_maiden", "griffin", "werewolf", "frightener", "ice_giant", "grave_hag",
|
||
//"vampire_katakan",
|
||
"crone_whispess", "crone_brewess", "crone_brewess", "crone_whispess", "crone_weavess", "crone_weavess", "arachas_behemoth", "fire_elemental", "fiend", "earth_elemental"]
|
||
};
|
||
|
||
},{}],4:[function(require,module,exports){
|
||
'use strict';
|
||
|
||
var randomFromSeed = require('./random/random-from-seed');
|
||
|
||
var ORIGINAL = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_-';
|
||
var alphabet;
|
||
var previousSeed;
|
||
|
||
var shuffled;
|
||
|
||
function reset() {
|
||
shuffled = false;
|
||
}
|
||
|
||
function setCharacters(_alphabet_) {
|
||
if (!_alphabet_) {
|
||
if (alphabet !== ORIGINAL) {
|
||
alphabet = ORIGINAL;
|
||
reset();
|
||
}
|
||
return;
|
||
}
|
||
|
||
if (_alphabet_ === alphabet) {
|
||
return;
|
||
}
|
||
|
||
if (_alphabet_.length !== ORIGINAL.length) {
|
||
throw new Error('Custom alphabet for shortid must be ' + ORIGINAL.length + ' unique characters. You submitted ' + _alphabet_.length + ' characters: ' + _alphabet_);
|
||
}
|
||
|
||
var unique = _alphabet_.split('').filter(function(item, ind, arr){
|
||
return ind !== arr.lastIndexOf(item);
|
||
});
|
||
|
||
if (unique.length) {
|
||
throw new Error('Custom alphabet for shortid must be ' + ORIGINAL.length + ' unique characters. These characters were not unique: ' + unique.join(', '));
|
||
}
|
||
|
||
alphabet = _alphabet_;
|
||
reset();
|
||
}
|
||
|
||
function characters(_alphabet_) {
|
||
setCharacters(_alphabet_);
|
||
return alphabet;
|
||
}
|
||
|
||
function setSeed(seed) {
|
||
randomFromSeed.seed(seed);
|
||
if (previousSeed !== seed) {
|
||
reset();
|
||
previousSeed = seed;
|
||
}
|
||
}
|
||
|
||
function shuffle() {
|
||
if (!alphabet) {
|
||
setCharacters(ORIGINAL);
|
||
}
|
||
|
||
var sourceArray = alphabet.split('');
|
||
var targetArray = [];
|
||
var r = randomFromSeed.nextValue();
|
||
var characterIndex;
|
||
|
||
while (sourceArray.length > 0) {
|
||
r = randomFromSeed.nextValue();
|
||
characterIndex = Math.floor(r * sourceArray.length);
|
||
targetArray.push(sourceArray.splice(characterIndex, 1)[0]);
|
||
}
|
||
return targetArray.join('');
|
||
}
|
||
|
||
function getShuffled() {
|
||
if (shuffled) {
|
||
return shuffled;
|
||
}
|
||
shuffled = shuffle();
|
||
return shuffled;
|
||
}
|
||
|
||
/**
|
||
* lookup shuffled letter
|
||
* @param index
|
||
* @returns {string}
|
||
*/
|
||
function lookup(index) {
|
||
var alphabetShuffled = getShuffled();
|
||
return alphabetShuffled[index];
|
||
}
|
||
|
||
module.exports = {
|
||
characters: characters,
|
||
seed: setSeed,
|
||
lookup: lookup,
|
||
shuffled: getShuffled
|
||
};
|
||
|
||
},{"./random/random-from-seed":10}],5:[function(require,module,exports){
|
||
'use strict';
|
||
var alphabet = require('./alphabet');
|
||
|
||
/**
|
||
* Decode the id to get the version and worker
|
||
* Mainly for debugging and testing.
|
||
* @param id - the shortid-generated id.
|
||
*/
|
||
function decode(id) {
|
||
var characters = alphabet.shuffled();
|
||
return {
|
||
version: characters.indexOf(id.substr(0, 1)) & 0x0f,
|
||
worker: characters.indexOf(id.substr(1, 1)) & 0x0f
|
||
};
|
||
}
|
||
|
||
module.exports = decode;
|
||
|
||
},{"./alphabet":4}],6:[function(require,module,exports){
|
||
'use strict';
|
||
|
||
var randomByte = require('./random/random-byte');
|
||
|
||
function encode(lookup, number) {
|
||
var loopCounter = 0;
|
||
var done;
|
||
|
||
var str = '';
|
||
|
||
while (!done) {
|
||
str = str + lookup( ( (number >> (4 * loopCounter)) & 0x0f ) | randomByte() );
|
||
done = number < (Math.pow(16, loopCounter + 1 ) );
|
||
loopCounter++;
|
||
}
|
||
return str;
|
||
}
|
||
|
||
module.exports = encode;
|
||
|
||
},{"./random/random-byte":9}],7:[function(require,module,exports){
|
||
'use strict';
|
||
|
||
var alphabet = require('./alphabet');
|
||
var encode = require('./encode');
|
||
var decode = require('./decode');
|
||
var isValid = require('./is-valid');
|
||
|
||
// Ignore all milliseconds before a certain time to reduce the size of the date entropy without sacrificing uniqueness.
|
||
// This number should be updated every year or so to keep the generated id short.
|
||
// To regenerate `new Date() - 0` and bump the version. Always bump the version!
|
||
var REDUCE_TIME = 1426452414093;
|
||
|
||
// don't change unless we change the algos or REDUCE_TIME
|
||
// must be an integer and less than 16
|
||
var version = 5;
|
||
|
||
// if you are using cluster or multiple servers use this to make each instance
|
||
// has a unique value for worker
|
||
// Note: I don't know if this is automatically set when using third
|
||
// party cluster solutions such as pm2.
|
||
var clusterWorkerId = require('./util/cluster-worker-id') || 0;
|
||
|
||
// Counter is used when shortid is called multiple times in one second.
|
||
var counter;
|
||
|
||
// Remember the last time shortid was called in case counter is needed.
|
||
var previousSeconds;
|
||
|
||
/**
|
||
* Generate unique id
|
||
* Returns string id
|
||
*/
|
||
function generate() {
|
||
|
||
var str = '';
|
||
|
||
var seconds = Math.floor((Date.now() - REDUCE_TIME) * 0.001);
|
||
|
||
if (seconds === previousSeconds) {
|
||
counter++;
|
||
} else {
|
||
counter = 0;
|
||
previousSeconds = seconds;
|
||
}
|
||
|
||
str = str + encode(alphabet.lookup, version);
|
||
str = str + encode(alphabet.lookup, clusterWorkerId);
|
||
if (counter > 0) {
|
||
str = str + encode(alphabet.lookup, counter);
|
||
}
|
||
str = str + encode(alphabet.lookup, seconds);
|
||
|
||
return str;
|
||
}
|
||
|
||
|
||
/**
|
||
* Set the seed.
|
||
* Highly recommended if you don't want people to try to figure out your id schema.
|
||
* exposed as shortid.seed(int)
|
||
* @param seed Integer value to seed the random alphabet. ALWAYS USE THE SAME SEED or you might get overlaps.
|
||
*/
|
||
function seed(seedValue) {
|
||
alphabet.seed(seedValue);
|
||
return module.exports;
|
||
}
|
||
|
||
/**
|
||
* Set the cluster worker or machine id
|
||
* exposed as shortid.worker(int)
|
||
* @param workerId worker must be positive integer. Number less than 16 is recommended.
|
||
* returns shortid module so it can be chained.
|
||
*/
|
||
function worker(workerId) {
|
||
clusterWorkerId = workerId;
|
||
return module.exports;
|
||
}
|
||
|
||
/**
|
||
*
|
||
* sets new characters to use in the alphabet
|
||
* returns the shuffled alphabet
|
||
*/
|
||
function characters(newCharacters) {
|
||
if (newCharacters !== undefined) {
|
||
alphabet.characters(newCharacters);
|
||
}
|
||
|
||
return alphabet.shuffled();
|
||
}
|
||
|
||
|
||
// Export all other functions as properties of the generate function
|
||
module.exports = generate;
|
||
module.exports.generate = generate;
|
||
module.exports.seed = seed;
|
||
module.exports.worker = worker;
|
||
module.exports.characters = characters;
|
||
module.exports.decode = decode;
|
||
module.exports.isValid = isValid;
|
||
|
||
},{"./alphabet":4,"./decode":5,"./encode":6,"./is-valid":8,"./util/cluster-worker-id":11}],8:[function(require,module,exports){
|
||
'use strict';
|
||
var alphabet = require('./alphabet');
|
||
|
||
function isShortId(id) {
|
||
if (!id || typeof id !== 'string' || id.length < 6 ) {
|
||
return false;
|
||
}
|
||
|
||
var characters = alphabet.characters();
|
||
var invalidCharacters = id.split('').map(function(char){
|
||
if (characters.indexOf(char) === -1) {
|
||
return char;
|
||
}
|
||
}).join('').split('').join('');
|
||
|
||
return invalidCharacters.length === 0;
|
||
}
|
||
|
||
module.exports = isShortId;
|
||
|
||
},{"./alphabet":4}],9:[function(require,module,exports){
|
||
'use strict';
|
||
|
||
var crypto = window.crypto || window.msCrypto; // IE 11 uses window.msCrypto
|
||
|
||
function randomByte() {
|
||
if (!crypto || !crypto.getRandomValues) {
|
||
return Math.floor(Math.random() * 256) & 0x30;
|
||
}
|
||
var dest = new Uint8Array(1);
|
||
crypto.getRandomValues(dest);
|
||
return dest[0] & 0x30;
|
||
}
|
||
|
||
module.exports = randomByte;
|
||
|
||
},{}],10:[function(require,module,exports){
|
||
'use strict';
|
||
|
||
// Found this seed-based random generator somewhere
|
||
// Based on The Central Randomizer 1.3 (C) 1997 by Paul Houle (houle@msc.cornell.edu)
|
||
|
||
var seed = 1;
|
||
|
||
/**
|
||
* return a random number based on a seed
|
||
* @param seed
|
||
* @returns {number}
|
||
*/
|
||
function getNextValue() {
|
||
seed = (seed * 9301 + 49297) % 233280;
|
||
return seed/(233280.0);
|
||
}
|
||
|
||
function setSeed(_seed_) {
|
||
seed = _seed_;
|
||
}
|
||
|
||
module.exports = {
|
||
nextValue: getNextValue,
|
||
seed: setSeed
|
||
};
|
||
|
||
},{}],11:[function(require,module,exports){
|
||
'use strict';
|
||
|
||
module.exports = 0;
|
||
|
||
},{}],12:[function(require,module,exports){
|
||
// Underscore.js 1.8.3
|
||
// http://underscorejs.org
|
||
// (c) 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
||
// Underscore may be freely distributed under the MIT license.
|
||
|
||
(function() {
|
||
|
||
// Baseline setup
|
||
// --------------
|
||
|
||
// Establish the root object, `window` in the browser, or `exports` on the server.
|
||
var root = this;
|
||
|
||
// Save the previous value of the `_` variable.
|
||
var previousUnderscore = root._;
|
||
|
||
// Save bytes in the minified (but not gzipped) version:
|
||
var ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype;
|
||
|
||
// Create quick reference variables for speed access to core prototypes.
|
||
var
|
||
push = ArrayProto.push,
|
||
slice = ArrayProto.slice,
|
||
toString = ObjProto.toString,
|
||
hasOwnProperty = ObjProto.hasOwnProperty;
|
||
|
||
// All **ECMAScript 5** native function implementations that we hope to use
|
||
// are declared here.
|
||
var
|
||
nativeIsArray = Array.isArray,
|
||
nativeKeys = Object.keys,
|
||
nativeBind = FuncProto.bind,
|
||
nativeCreate = Object.create;
|
||
|
||
// Naked function reference for surrogate-prototype-swapping.
|
||
var Ctor = function(){};
|
||
|
||
// Create a safe reference to the Underscore object for use below.
|
||
var _ = function(obj) {
|
||
if (obj instanceof _) return obj;
|
||
if (!(this instanceof _)) return new _(obj);
|
||
this._wrapped = obj;
|
||
};
|
||
|
||
// Export the Underscore object for **Node.js**, with
|
||
// backwards-compatibility for the old `require()` API. If we're in
|
||
// the browser, add `_` as a global object.
|
||
if (typeof exports !== 'undefined') {
|
||
if (typeof module !== 'undefined' && module.exports) {
|
||
exports = module.exports = _;
|
||
}
|
||
exports._ = _;
|
||
} else {
|
||
root._ = _;
|
||
}
|
||
|
||
// Current version.
|
||
_.VERSION = '1.8.3';
|
||
|
||
// Internal function that returns an efficient (for current engines) version
|
||
// of the passed-in callback, to be repeatedly applied in other Underscore
|
||
// functions.
|
||
var optimizeCb = function(func, context, argCount) {
|
||
if (context === void 0) return func;
|
||
switch (argCount == null ? 3 : argCount) {
|
||
case 1: return function(value) {
|
||
return func.call(context, value);
|
||
};
|
||
case 2: return function(value, other) {
|
||
return func.call(context, value, other);
|
||
};
|
||
case 3: return function(value, index, collection) {
|
||
return func.call(context, value, index, collection);
|
||
};
|
||
case 4: return function(accumulator, value, index, collection) {
|
||
return func.call(context, accumulator, value, index, collection);
|
||
};
|
||
}
|
||
return function() {
|
||
return func.apply(context, arguments);
|
||
};
|
||
};
|
||
|
||
// A mostly-internal function to generate callbacks that can be applied
|
||
// to each element in a collection, returning the desired result — either
|
||
// identity, an arbitrary callback, a property matcher, or a property accessor.
|
||
var cb = function(value, context, argCount) {
|
||
if (value == null) return _.identity;
|
||
if (_.isFunction(value)) return optimizeCb(value, context, argCount);
|
||
if (_.isObject(value)) return _.matcher(value);
|
||
return _.property(value);
|
||
};
|
||
_.iteratee = function(value, context) {
|
||
return cb(value, context, Infinity);
|
||
};
|
||
|
||
// An internal function for creating assigner functions.
|
||
var createAssigner = function(keysFunc, undefinedOnly) {
|
||
return function(obj) {
|
||
var length = arguments.length;
|
||
if (length < 2 || obj == null) return obj;
|
||
for (var index = 1; index < length; index++) {
|
||
var source = arguments[index],
|
||
keys = keysFunc(source),
|
||
l = keys.length;
|
||
for (var i = 0; i < l; i++) {
|
||
var key = keys[i];
|
||
if (!undefinedOnly || obj[key] === void 0) obj[key] = source[key];
|
||
}
|
||
}
|
||
return obj;
|
||
};
|
||
};
|
||
|
||
// An internal function for creating a new object that inherits from another.
|
||
var baseCreate = function(prototype) {
|
||
if (!_.isObject(prototype)) return {};
|
||
if (nativeCreate) return nativeCreate(prototype);
|
||
Ctor.prototype = prototype;
|
||
var result = new Ctor;
|
||
Ctor.prototype = null;
|
||
return result;
|
||
};
|
||
|
||
var property = function(key) {
|
||
return function(obj) {
|
||
return obj == null ? void 0 : obj[key];
|
||
};
|
||
};
|
||
|
||
// Helper for collection methods to determine whether a collection
|
||
// should be iterated as an array or as an object
|
||
// Related: http://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength
|
||
// Avoids a very nasty iOS 8 JIT bug on ARM-64. #2094
|
||
var MAX_ARRAY_INDEX = Math.pow(2, 53) - 1;
|
||
var getLength = property('length');
|
||
var isArrayLike = function(collection) {
|
||
var length = getLength(collection);
|
||
return typeof length == 'number' && length >= 0 && length <= MAX_ARRAY_INDEX;
|
||
};
|
||
|
||
// Collection Functions
|
||
// --------------------
|
||
|
||
// The cornerstone, an `each` implementation, aka `forEach`.
|
||
// Handles raw objects in addition to array-likes. Treats all
|
||
// sparse array-likes as if they were dense.
|
||
_.each = _.forEach = function(obj, iteratee, context) {
|
||
iteratee = optimizeCb(iteratee, context);
|
||
var i, length;
|
||
if (isArrayLike(obj)) {
|
||
for (i = 0, length = obj.length; i < length; i++) {
|
||
iteratee(obj[i], i, obj);
|
||
}
|
||
} else {
|
||
var keys = _.keys(obj);
|
||
for (i = 0, length = keys.length; i < length; i++) {
|
||
iteratee(obj[keys[i]], keys[i], obj);
|
||
}
|
||
}
|
||
return obj;
|
||
};
|
||
|
||
// Return the results of applying the iteratee to each element.
|
||
_.map = _.collect = function(obj, iteratee, context) {
|
||
iteratee = cb(iteratee, context);
|
||
var keys = !isArrayLike(obj) && _.keys(obj),
|
||
length = (keys || obj).length,
|
||
results = Array(length);
|
||
for (var index = 0; index < length; index++) {
|
||
var currentKey = keys ? keys[index] : index;
|
||
results[index] = iteratee(obj[currentKey], currentKey, obj);
|
||
}
|
||
return results;
|
||
};
|
||
|
||
// Create a reducing function iterating left or right.
|
||
function createReduce(dir) {
|
||
// Optimized iterator function as using arguments.length
|
||
// in the main function will deoptimize the, see #1991.
|
||
function iterator(obj, iteratee, memo, keys, index, length) {
|
||
for (; index >= 0 && index < length; index += dir) {
|
||
var currentKey = keys ? keys[index] : index;
|
||
memo = iteratee(memo, obj[currentKey], currentKey, obj);
|
||
}
|
||
return memo;
|
||
}
|
||
|
||
return function(obj, iteratee, memo, context) {
|
||
iteratee = optimizeCb(iteratee, context, 4);
|
||
var keys = !isArrayLike(obj) && _.keys(obj),
|
||
length = (keys || obj).length,
|
||
index = dir > 0 ? 0 : length - 1;
|
||
// Determine the initial value if none is provided.
|
||
if (arguments.length < 3) {
|
||
memo = obj[keys ? keys[index] : index];
|
||
index += dir;
|
||
}
|
||
return iterator(obj, iteratee, memo, keys, index, length);
|
||
};
|
||
}
|
||
|
||
// **Reduce** builds up a single result from a list of values, aka `inject`,
|
||
// or `foldl`.
|
||
_.reduce = _.foldl = _.inject = createReduce(1);
|
||
|
||
// The right-associative version of reduce, also known as `foldr`.
|
||
_.reduceRight = _.foldr = createReduce(-1);
|
||
|
||
// Return the first value which passes a truth test. Aliased as `detect`.
|
||
_.find = _.detect = function(obj, predicate, context) {
|
||
var key;
|
||
if (isArrayLike(obj)) {
|
||
key = _.findIndex(obj, predicate, context);
|
||
} else {
|
||
key = _.findKey(obj, predicate, context);
|
||
}
|
||
if (key !== void 0 && key !== -1) return obj[key];
|
||
};
|
||
|
||
// Return all the elements that pass a truth test.
|
||
// Aliased as `select`.
|
||
_.filter = _.select = function(obj, predicate, context) {
|
||
var results = [];
|
||
predicate = cb(predicate, context);
|
||
_.each(obj, function(value, index, list) {
|
||
if (predicate(value, index, list)) results.push(value);
|
||
});
|
||
return results;
|
||
};
|
||
|
||
// Return all the elements for which a truth test fails.
|
||
_.reject = function(obj, predicate, context) {
|
||
return _.filter(obj, _.negate(cb(predicate)), context);
|
||
};
|
||
|
||
// Determine whether all of the elements match a truth test.
|
||
// Aliased as `all`.
|
||
_.every = _.all = function(obj, predicate, context) {
|
||
predicate = cb(predicate, context);
|
||
var keys = !isArrayLike(obj) && _.keys(obj),
|
||
length = (keys || obj).length;
|
||
for (var index = 0; index < length; index++) {
|
||
var currentKey = keys ? keys[index] : index;
|
||
if (!predicate(obj[currentKey], currentKey, obj)) return false;
|
||
}
|
||
return true;
|
||
};
|
||
|
||
// Determine if at least one element in the object matches a truth test.
|
||
// Aliased as `any`.
|
||
_.some = _.any = function(obj, predicate, context) {
|
||
predicate = cb(predicate, context);
|
||
var keys = !isArrayLike(obj) && _.keys(obj),
|
||
length = (keys || obj).length;
|
||
for (var index = 0; index < length; index++) {
|
||
var currentKey = keys ? keys[index] : index;
|
||
if (predicate(obj[currentKey], currentKey, obj)) return true;
|
||
}
|
||
return false;
|
||
};
|
||
|
||
// Determine if the array or object contains a given item (using `===`).
|
||
// Aliased as `includes` and `include`.
|
||
_.contains = _.includes = _.include = function(obj, item, fromIndex, guard) {
|
||
if (!isArrayLike(obj)) obj = _.values(obj);
|
||
if (typeof fromIndex != 'number' || guard) fromIndex = 0;
|
||
return _.indexOf(obj, item, fromIndex) >= 0;
|
||
};
|
||
|
||
// Invoke a method (with arguments) on every item in a collection.
|
||
_.invoke = function(obj, method) {
|
||
var args = slice.call(arguments, 2);
|
||
var isFunc = _.isFunction(method);
|
||
return _.map(obj, function(value) {
|
||
var func = isFunc ? method : value[method];
|
||
return func == null ? func : func.apply(value, args);
|
||
});
|
||
};
|
||
|
||
// Convenience version of a common use case of `map`: fetching a property.
|
||
_.pluck = function(obj, key) {
|
||
return _.map(obj, _.property(key));
|
||
};
|
||
|
||
// Convenience version of a common use case of `filter`: selecting only objects
|
||
// containing specific `key:value` pairs.
|
||
_.where = function(obj, attrs) {
|
||
return _.filter(obj, _.matcher(attrs));
|
||
};
|
||
|
||
// Convenience version of a common use case of `find`: getting the first object
|
||
// containing specific `key:value` pairs.
|
||
_.findWhere = function(obj, attrs) {
|
||
return _.find(obj, _.matcher(attrs));
|
||
};
|
||
|
||
// Return the maximum element (or element-based computation).
|
||
_.max = function(obj, iteratee, context) {
|
||
var result = -Infinity, lastComputed = -Infinity,
|
||
value, computed;
|
||
if (iteratee == null && obj != null) {
|
||
obj = isArrayLike(obj) ? obj : _.values(obj);
|
||
for (var i = 0, length = obj.length; i < length; i++) {
|
||
value = obj[i];
|
||
if (value > result) {
|
||
result = value;
|
||
}
|
||
}
|
||
} else {
|
||
iteratee = cb(iteratee, context);
|
||
_.each(obj, function(value, index, list) {
|
||
computed = iteratee(value, index, list);
|
||
if (computed > lastComputed || computed === -Infinity && result === -Infinity) {
|
||
result = value;
|
||
lastComputed = computed;
|
||
}
|
||
});
|
||
}
|
||
return result;
|
||
};
|
||
|
||
// Return the minimum element (or element-based computation).
|
||
_.min = function(obj, iteratee, context) {
|
||
var result = Infinity, lastComputed = Infinity,
|
||
value, computed;
|
||
if (iteratee == null && obj != null) {
|
||
obj = isArrayLike(obj) ? obj : _.values(obj);
|
||
for (var i = 0, length = obj.length; i < length; i++) {
|
||
value = obj[i];
|
||
if (value < result) {
|
||
result = value;
|
||
}
|
||
}
|
||
} else {
|
||
iteratee = cb(iteratee, context);
|
||
_.each(obj, function(value, index, list) {
|
||
computed = iteratee(value, index, list);
|
||
if (computed < lastComputed || computed === Infinity && result === Infinity) {
|
||
result = value;
|
||
lastComputed = computed;
|
||
}
|
||
});
|
||
}
|
||
return result;
|
||
};
|
||
|
||
// Shuffle a collection, using the modern version of the
|
||
// [Fisher-Yates shuffle](http://en.wikipedia.org/wiki/Fisher–Yates_shuffle).
|
||
_.shuffle = function(obj) {
|
||
var set = isArrayLike(obj) ? obj : _.values(obj);
|
||
var length = set.length;
|
||
var shuffled = Array(length);
|
||
for (var index = 0, rand; index < length; index++) {
|
||
rand = _.random(0, index);
|
||
if (rand !== index) shuffled[index] = shuffled[rand];
|
||
shuffled[rand] = set[index];
|
||
}
|
||
return shuffled;
|
||
};
|
||
|
||
// Sample **n** random values from a collection.
|
||
// If **n** is not specified, returns a single random element.
|
||
// The internal `guard` argument allows it to work with `map`.
|
||
_.sample = function(obj, n, guard) {
|
||
if (n == null || guard) {
|
||
if (!isArrayLike(obj)) obj = _.values(obj);
|
||
return obj[_.random(obj.length - 1)];
|
||
}
|
||
return _.shuffle(obj).slice(0, Math.max(0, n));
|
||
};
|
||
|
||
// Sort the object's values by a criterion produced by an iteratee.
|
||
_.sortBy = function(obj, iteratee, context) {
|
||
iteratee = cb(iteratee, context);
|
||
return _.pluck(_.map(obj, function(value, index, list) {
|
||
return {
|
||
value: value,
|
||
index: index,
|
||
criteria: iteratee(value, index, list)
|
||
};
|
||
}).sort(function(left, right) {
|
||
var a = left.criteria;
|
||
var b = right.criteria;
|
||
if (a !== b) {
|
||
if (a > b || a === void 0) return 1;
|
||
if (a < b || b === void 0) return -1;
|
||
}
|
||
return left.index - right.index;
|
||
}), 'value');
|
||
};
|
||
|
||
// An internal function used for aggregate "group by" operations.
|
||
var group = function(behavior) {
|
||
return function(obj, iteratee, context) {
|
||
var result = {};
|
||
iteratee = cb(iteratee, context);
|
||
_.each(obj, function(value, index) {
|
||
var key = iteratee(value, index, obj);
|
||
behavior(result, value, key);
|
||
});
|
||
return result;
|
||
};
|
||
};
|
||
|
||
// Groups the object's values by a criterion. Pass either a string attribute
|
||
// to group by, or a function that returns the criterion.
|
||
_.groupBy = group(function(result, value, key) {
|
||
if (_.has(result, key)) result[key].push(value); else result[key] = [value];
|
||
});
|
||
|
||
// Indexes the object's values by a criterion, similar to `groupBy`, but for
|
||
// when you know that your index values will be unique.
|
||
_.indexBy = group(function(result, value, key) {
|
||
result[key] = value;
|
||
});
|
||
|
||
// Counts instances of an object that group by a certain criterion. Pass
|
||
// either a string attribute to count by, or a function that returns the
|
||
// criterion.
|
||
_.countBy = group(function(result, value, key) {
|
||
if (_.has(result, key)) result[key]++; else result[key] = 1;
|
||
});
|
||
|
||
// Safely create a real, live array from anything iterable.
|
||
_.toArray = function(obj) {
|
||
if (!obj) return [];
|
||
if (_.isArray(obj)) return slice.call(obj);
|
||
if (isArrayLike(obj)) return _.map(obj, _.identity);
|
||
return _.values(obj);
|
||
};
|
||
|
||
// Return the number of elements in an object.
|
||
_.size = function(obj) {
|
||
if (obj == null) return 0;
|
||
return isArrayLike(obj) ? obj.length : _.keys(obj).length;
|
||
};
|
||
|
||
// Split a collection into two arrays: one whose elements all satisfy the given
|
||
// predicate, and one whose elements all do not satisfy the predicate.
|
||
_.partition = function(obj, predicate, context) {
|
||
predicate = cb(predicate, context);
|
||
var pass = [], fail = [];
|
||
_.each(obj, function(value, key, obj) {
|
||
(predicate(value, key, obj) ? pass : fail).push(value);
|
||
});
|
||
return [pass, fail];
|
||
};
|
||
|
||
// Array Functions
|
||
// ---------------
|
||
|
||
// Get the first element of an array. Passing **n** will return the first N
|
||
// values in the array. Aliased as `head` and `take`. The **guard** check
|
||
// allows it to work with `_.map`.
|
||
_.first = _.head = _.take = function(array, n, guard) {
|
||
if (array == null) return void 0;
|
||
if (n == null || guard) return array[0];
|
||
return _.initial(array, array.length - n);
|
||
};
|
||
|
||
// Returns everything but the last entry of the array. Especially useful on
|
||
// the arguments object. Passing **n** will return all the values in
|
||
// the array, excluding the last N.
|
||
_.initial = function(array, n, guard) {
|
||
return slice.call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n)));
|
||
};
|
||
|
||
// Get the last element of an array. Passing **n** will return the last N
|
||
// values in the array.
|
||
_.last = function(array, n, guard) {
|
||
if (array == null) return void 0;
|
||
if (n == null || guard) return array[array.length - 1];
|
||
return _.rest(array, Math.max(0, array.length - n));
|
||
};
|
||
|
||
// Returns everything but the first entry of the array. Aliased as `tail` and `drop`.
|
||
// Especially useful on the arguments object. Passing an **n** will return
|
||
// the rest N values in the array.
|
||
_.rest = _.tail = _.drop = function(array, n, guard) {
|
||
return slice.call(array, n == null || guard ? 1 : n);
|
||
};
|
||
|
||
// Trim out all falsy values from an array.
|
||
_.compact = function(array) {
|
||
return _.filter(array, _.identity);
|
||
};
|
||
|
||
// Internal implementation of a recursive `flatten` function.
|
||
var flatten = function(input, shallow, strict, startIndex) {
|
||
var output = [], idx = 0;
|
||
for (var i = startIndex || 0, length = getLength(input); i < length; i++) {
|
||
var value = input[i];
|
||
if (isArrayLike(value) && (_.isArray(value) || _.isArguments(value))) {
|
||
//flatten current level of array or arguments object
|
||
if (!shallow) value = flatten(value, shallow, strict);
|
||
var j = 0, len = value.length;
|
||
output.length += len;
|
||
while (j < len) {
|
||
output[idx++] = value[j++];
|
||
}
|
||
} else if (!strict) {
|
||
output[idx++] = value;
|
||
}
|
||
}
|
||
return output;
|
||
};
|
||
|
||
// Flatten out an array, either recursively (by default), or just one level.
|
||
_.flatten = function(array, shallow) {
|
||
return flatten(array, shallow, false);
|
||
};
|
||
|
||
// Return a version of the array that does not contain the specified value(s).
|
||
_.without = function(array) {
|
||
return _.difference(array, slice.call(arguments, 1));
|
||
};
|
||
|
||
// Produce a duplicate-free version of the array. If the array has already
|
||
// been sorted, you have the option of using a faster algorithm.
|
||
// Aliased as `unique`.
|
||
_.uniq = _.unique = function(array, isSorted, iteratee, context) {
|
||
if (!_.isBoolean(isSorted)) {
|
||
context = iteratee;
|
||
iteratee = isSorted;
|
||
isSorted = false;
|
||
}
|
||
if (iteratee != null) iteratee = cb(iteratee, context);
|
||
var result = [];
|
||
var seen = [];
|
||
for (var i = 0, length = getLength(array); i < length; i++) {
|
||
var value = array[i],
|
||
computed = iteratee ? iteratee(value, i, array) : value;
|
||
if (isSorted) {
|
||
if (!i || seen !== computed) result.push(value);
|
||
seen = computed;
|
||
} else if (iteratee) {
|
||
if (!_.contains(seen, computed)) {
|
||
seen.push(computed);
|
||
result.push(value);
|
||
}
|
||
} else if (!_.contains(result, value)) {
|
||
result.push(value);
|
||
}
|
||
}
|
||
return result;
|
||
};
|
||
|
||
// Produce an array that contains the union: each distinct element from all of
|
||
// the passed-in arrays.
|
||
_.union = function() {
|
||
return _.uniq(flatten(arguments, true, true));
|
||
};
|
||
|
||
// Produce an array that contains every item shared between all the
|
||
// passed-in arrays.
|
||
_.intersection = function(array) {
|
||
var result = [];
|
||
var argsLength = arguments.length;
|
||
for (var i = 0, length = getLength(array); i < length; i++) {
|
||
var item = array[i];
|
||
if (_.contains(result, item)) continue;
|
||
for (var j = 1; j < argsLength; j++) {
|
||
if (!_.contains(arguments[j], item)) break;
|
||
}
|
||
if (j === argsLength) result.push(item);
|
||
}
|
||
return result;
|
||
};
|
||
|
||
// Take the difference between one array and a number of other arrays.
|
||
// Only the elements present in just the first array will remain.
|
||
_.difference = function(array) {
|
||
var rest = flatten(arguments, true, true, 1);
|
||
return _.filter(array, function(value){
|
||
return !_.contains(rest, value);
|
||
});
|
||
};
|
||
|
||
// Zip together multiple lists into a single array -- elements that share
|
||
// an index go together.
|
||
_.zip = function() {
|
||
return _.unzip(arguments);
|
||
};
|
||
|
||
// Complement of _.zip. Unzip accepts an array of arrays and groups
|
||
// each array's elements on shared indices
|
||
_.unzip = function(array) {
|
||
var length = array && _.max(array, getLength).length || 0;
|
||
var result = Array(length);
|
||
|
||
for (var index = 0; index < length; index++) {
|
||
result[index] = _.pluck(array, index);
|
||
}
|
||
return result;
|
||
};
|
||
|
||
// Converts lists into objects. Pass either a single array of `[key, value]`
|
||
// pairs, or two parallel arrays of the same length -- one of keys, and one of
|
||
// the corresponding values.
|
||
_.object = function(list, values) {
|
||
var result = {};
|
||
for (var i = 0, length = getLength(list); i < length; i++) {
|
||
if (values) {
|
||
result[list[i]] = values[i];
|
||
} else {
|
||
result[list[i][0]] = list[i][1];
|
||
}
|
||
}
|
||
return result;
|
||
};
|
||
|
||
// Generator function to create the findIndex and findLastIndex functions
|
||
function createPredicateIndexFinder(dir) {
|
||
return function(array, predicate, context) {
|
||
predicate = cb(predicate, context);
|
||
var length = getLength(array);
|
||
var index = dir > 0 ? 0 : length - 1;
|
||
for (; index >= 0 && index < length; index += dir) {
|
||
if (predicate(array[index], index, array)) return index;
|
||
}
|
||
return -1;
|
||
};
|
||
}
|
||
|
||
// Returns the first index on an array-like that passes a predicate test
|
||
_.findIndex = createPredicateIndexFinder(1);
|
||
_.findLastIndex = createPredicateIndexFinder(-1);
|
||
|
||
// Use a comparator function to figure out the smallest index at which
|
||
// an object should be inserted so as to maintain order. Uses binary search.
|
||
_.sortedIndex = function(array, obj, iteratee, context) {
|
||
iteratee = cb(iteratee, context, 1);
|
||
var value = iteratee(obj);
|
||
var low = 0, high = getLength(array);
|
||
while (low < high) {
|
||
var mid = Math.floor((low + high) / 2);
|
||
if (iteratee(array[mid]) < value) low = mid + 1; else high = mid;
|
||
}
|
||
return low;
|
||
};
|
||
|
||
// Generator function to create the indexOf and lastIndexOf functions
|
||
function createIndexFinder(dir, predicateFind, sortedIndex) {
|
||
return function(array, item, idx) {
|
||
var i = 0, length = getLength(array);
|
||
if (typeof idx == 'number') {
|
||
if (dir > 0) {
|
||
i = idx >= 0 ? idx : Math.max(idx + length, i);
|
||
} else {
|
||
length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;
|
||
}
|
||
} else if (sortedIndex && idx && length) {
|
||
idx = sortedIndex(array, item);
|
||
return array[idx] === item ? idx : -1;
|
||
}
|
||
if (item !== item) {
|
||
idx = predicateFind(slice.call(array, i, length), _.isNaN);
|
||
return idx >= 0 ? idx + i : -1;
|
||
}
|
||
for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {
|
||
if (array[idx] === item) return idx;
|
||
}
|
||
return -1;
|
||
};
|
||
}
|
||
|
||
// Return the position of the first occurrence of an item in an array,
|
||
// or -1 if the item is not included in the array.
|
||
// If the array is large and already in sort order, pass `true`
|
||
// for **isSorted** to use binary search.
|
||
_.indexOf = createIndexFinder(1, _.findIndex, _.sortedIndex);
|
||
_.lastIndexOf = createIndexFinder(-1, _.findLastIndex);
|
||
|
||
// Generate an integer Array containing an arithmetic progression. A port of
|
||
// the native Python `range()` function. See
|
||
// [the Python documentation](http://docs.python.org/library/functions.html#range).
|
||
_.range = function(start, stop, step) {
|
||
if (stop == null) {
|
||
stop = start || 0;
|
||
start = 0;
|
||
}
|
||
step = step || 1;
|
||
|
||
var length = Math.max(Math.ceil((stop - start) / step), 0);
|
||
var range = Array(length);
|
||
|
||
for (var idx = 0; idx < length; idx++, start += step) {
|
||
range[idx] = start;
|
||
}
|
||
|
||
return range;
|
||
};
|
||
|
||
// Function (ahem) Functions
|
||
// ------------------
|
||
|
||
// Determines whether to execute a function as a constructor
|
||
// or a normal function with the provided arguments
|
||
var executeBound = function(sourceFunc, boundFunc, context, callingContext, args) {
|
||
if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args);
|
||
var self = baseCreate(sourceFunc.prototype);
|
||
var result = sourceFunc.apply(self, args);
|
||
if (_.isObject(result)) return result;
|
||
return self;
|
||
};
|
||
|
||
// Create a function bound to a given object (assigning `this`, and arguments,
|
||
// optionally). Delegates to **ECMAScript 5**'s native `Function.bind` if
|
||
// available.
|
||
_.bind = function(func, context) {
|
||
if (nativeBind && func.bind === nativeBind) return nativeBind.apply(func, slice.call(arguments, 1));
|
||
if (!_.isFunction(func)) throw new TypeError('Bind must be called on a function');
|
||
var args = slice.call(arguments, 2);
|
||
var bound = function() {
|
||
return executeBound(func, bound, context, this, args.concat(slice.call(arguments)));
|
||
};
|
||
return bound;
|
||
};
|
||
|
||
// Partially apply a function by creating a version that has had some of its
|
||
// arguments pre-filled, without changing its dynamic `this` context. _ acts
|
||
// as a placeholder, allowing any combination of arguments to be pre-filled.
|
||
_.partial = function(func) {
|
||
var boundArgs = slice.call(arguments, 1);
|
||
var bound = function() {
|
||
var position = 0, length = boundArgs.length;
|
||
var args = Array(length);
|
||
for (var i = 0; i < length; i++) {
|
||
args[i] = boundArgs[i] === _ ? arguments[position++] : boundArgs[i];
|
||
}
|
||
while (position < arguments.length) args.push(arguments[position++]);
|
||
return executeBound(func, bound, this, this, args);
|
||
};
|
||
return bound;
|
||
};
|
||
|
||
// Bind a number of an object's methods to that object. Remaining arguments
|
||
// are the method names to be bound. Useful for ensuring that all callbacks
|
||
// defined on an object belong to it.
|
||
_.bindAll = function(obj) {
|
||
var i, length = arguments.length, key;
|
||
if (length <= 1) throw new Error('bindAll must be passed function names');
|
||
for (i = 1; i < length; i++) {
|
||
key = arguments[i];
|
||
obj[key] = _.bind(obj[key], obj);
|
||
}
|
||
return obj;
|
||
};
|
||
|
||
// Memoize an expensive function by storing its results.
|
||
_.memoize = function(func, hasher) {
|
||
var memoize = function(key) {
|
||
var cache = memoize.cache;
|
||
var address = '' + (hasher ? hasher.apply(this, arguments) : key);
|
||
if (!_.has(cache, address)) cache[address] = func.apply(this, arguments);
|
||
return cache[address];
|
||
};
|
||
memoize.cache = {};
|
||
return memoize;
|
||
};
|
||
|
||
// Delays a function for the given number of milliseconds, and then calls
|
||
// it with the arguments supplied.
|
||
_.delay = function(func, wait) {
|
||
var args = slice.call(arguments, 2);
|
||
return setTimeout(function(){
|
||
return func.apply(null, args);
|
||
}, wait);
|
||
};
|
||
|
||
// Defers a function, scheduling it to run after the current call stack has
|
||
// cleared.
|
||
_.defer = _.partial(_.delay, _, 1);
|
||
|
||
// Returns a function, that, when invoked, will only be triggered at most once
|
||
// during a given window of time. Normally, the throttled function will run
|
||
// as much as it can, without ever going more than once per `wait` duration;
|
||
// but if you'd like to disable the execution on the leading edge, pass
|
||
// `{leading: false}`. To disable execution on the trailing edge, ditto.
|
||
_.throttle = function(func, wait, options) {
|
||
var context, args, result;
|
||
var timeout = null;
|
||
var previous = 0;
|
||
if (!options) options = {};
|
||
var later = function() {
|
||
previous = options.leading === false ? 0 : _.now();
|
||
timeout = null;
|
||
result = func.apply(context, args);
|
||
if (!timeout) context = args = null;
|
||
};
|
||
return function() {
|
||
var now = _.now();
|
||
if (!previous && options.leading === false) previous = now;
|
||
var remaining = wait - (now - previous);
|
||
context = this;
|
||
args = arguments;
|
||
if (remaining <= 0 || remaining > wait) {
|
||
if (timeout) {
|
||
clearTimeout(timeout);
|
||
timeout = null;
|
||
}
|
||
previous = now;
|
||
result = func.apply(context, args);
|
||
if (!timeout) context = args = null;
|
||
} else if (!timeout && options.trailing !== false) {
|
||
timeout = setTimeout(later, remaining);
|
||
}
|
||
return result;
|
||
};
|
||
};
|
||
|
||
// Returns a function, that, as long as it continues to be invoked, will not
|
||
// be triggered. The function will be called after it stops being called for
|
||
// N milliseconds. If `immediate` is passed, trigger the function on the
|
||
// leading edge, instead of the trailing.
|
||
_.debounce = function(func, wait, immediate) {
|
||
var timeout, args, context, timestamp, result;
|
||
|
||
var later = function() {
|
||
var last = _.now() - timestamp;
|
||
|
||
if (last < wait && last >= 0) {
|
||
timeout = setTimeout(later, wait - last);
|
||
} else {
|
||
timeout = null;
|
||
if (!immediate) {
|
||
result = func.apply(context, args);
|
||
if (!timeout) context = args = null;
|
||
}
|
||
}
|
||
};
|
||
|
||
return function() {
|
||
context = this;
|
||
args = arguments;
|
||
timestamp = _.now();
|
||
var callNow = immediate && !timeout;
|
||
if (!timeout) timeout = setTimeout(later, wait);
|
||
if (callNow) {
|
||
result = func.apply(context, args);
|
||
context = args = null;
|
||
}
|
||
|
||
return result;
|
||
};
|
||
};
|
||
|
||
// Returns the first function passed as an argument to the second,
|
||
// allowing you to adjust arguments, run code before and after, and
|
||
// conditionally execute the original function.
|
||
_.wrap = function(func, wrapper) {
|
||
return _.partial(wrapper, func);
|
||
};
|
||
|
||
// Returns a negated version of the passed-in predicate.
|
||
_.negate = function(predicate) {
|
||
return function() {
|
||
return !predicate.apply(this, arguments);
|
||
};
|
||
};
|
||
|
||
// Returns a function that is the composition of a list of functions, each
|
||
// consuming the return value of the function that follows.
|
||
_.compose = function() {
|
||
var args = arguments;
|
||
var start = args.length - 1;
|
||
return function() {
|
||
var i = start;
|
||
var result = args[start].apply(this, arguments);
|
||
while (i--) result = args[i].call(this, result);
|
||
return result;
|
||
};
|
||
};
|
||
|
||
// Returns a function that will only be executed on and after the Nth call.
|
||
_.after = function(times, func) {
|
||
return function() {
|
||
if (--times < 1) {
|
||
return func.apply(this, arguments);
|
||
}
|
||
};
|
||
};
|
||
|
||
// Returns a function that will only be executed up to (but not including) the Nth call.
|
||
_.before = function(times, func) {
|
||
var memo;
|
||
return function() {
|
||
if (--times > 0) {
|
||
memo = func.apply(this, arguments);
|
||
}
|
||
if (times <= 1) func = null;
|
||
return memo;
|
||
};
|
||
};
|
||
|
||
// Returns a function that will be executed at most one time, no matter how
|
||
// often you call it. Useful for lazy initialization.
|
||
_.once = _.partial(_.before, 2);
|
||
|
||
// Object Functions
|
||
// ----------------
|
||
|
||
// Keys in IE < 9 that won't be iterated by `for key in ...` and thus missed.
|
||
var hasEnumBug = !{toString: null}.propertyIsEnumerable('toString');
|
||
var nonEnumerableProps = ['valueOf', 'isPrototypeOf', 'toString',
|
||
'propertyIsEnumerable', 'hasOwnProperty', 'toLocaleString'];
|
||
|
||
function collectNonEnumProps(obj, keys) {
|
||
var nonEnumIdx = nonEnumerableProps.length;
|
||
var constructor = obj.constructor;
|
||
var proto = (_.isFunction(constructor) && constructor.prototype) || ObjProto;
|
||
|
||
// Constructor is a special case.
|
||
var prop = 'constructor';
|
||
if (_.has(obj, prop) && !_.contains(keys, prop)) keys.push(prop);
|
||
|
||
while (nonEnumIdx--) {
|
||
prop = nonEnumerableProps[nonEnumIdx];
|
||
if (prop in obj && obj[prop] !== proto[prop] && !_.contains(keys, prop)) {
|
||
keys.push(prop);
|
||
}
|
||
}
|
||
}
|
||
|
||
// Retrieve the names of an object's own properties.
|
||
// Delegates to **ECMAScript 5**'s native `Object.keys`
|
||
_.keys = function(obj) {
|
||
if (!_.isObject(obj)) return [];
|
||
if (nativeKeys) return nativeKeys(obj);
|
||
var keys = [];
|
||
for (var key in obj) if (_.has(obj, key)) keys.push(key);
|
||
// Ahem, IE < 9.
|
||
if (hasEnumBug) collectNonEnumProps(obj, keys);
|
||
return keys;
|
||
};
|
||
|
||
// Retrieve all the property names of an object.
|
||
_.allKeys = function(obj) {
|
||
if (!_.isObject(obj)) return [];
|
||
var keys = [];
|
||
for (var key in obj) keys.push(key);
|
||
// Ahem, IE < 9.
|
||
if (hasEnumBug) collectNonEnumProps(obj, keys);
|
||
return keys;
|
||
};
|
||
|
||
// Retrieve the values of an object's properties.
|
||
_.values = function(obj) {
|
||
var keys = _.keys(obj);
|
||
var length = keys.length;
|
||
var values = Array(length);
|
||
for (var i = 0; i < length; i++) {
|
||
values[i] = obj[keys[i]];
|
||
}
|
||
return values;
|
||
};
|
||
|
||
// Returns the results of applying the iteratee to each element of the object
|
||
// In contrast to _.map it returns an object
|
||
_.mapObject = function(obj, iteratee, context) {
|
||
iteratee = cb(iteratee, context);
|
||
var keys = _.keys(obj),
|
||
length = keys.length,
|
||
results = {},
|
||
currentKey;
|
||
for (var index = 0; index < length; index++) {
|
||
currentKey = keys[index];
|
||
results[currentKey] = iteratee(obj[currentKey], currentKey, obj);
|
||
}
|
||
return results;
|
||
};
|
||
|
||
// Convert an object into a list of `[key, value]` pairs.
|
||
_.pairs = function(obj) {
|
||
var keys = _.keys(obj);
|
||
var length = keys.length;
|
||
var pairs = Array(length);
|
||
for (var i = 0; i < length; i++) {
|
||
pairs[i] = [keys[i], obj[keys[i]]];
|
||
}
|
||
return pairs;
|
||
};
|
||
|
||
// Invert the keys and values of an object. The values must be serializable.
|
||
_.invert = function(obj) {
|
||
var result = {};
|
||
var keys = _.keys(obj);
|
||
for (var i = 0, length = keys.length; i < length; i++) {
|
||
result[obj[keys[i]]] = keys[i];
|
||
}
|
||
return result;
|
||
};
|
||
|
||
// Return a sorted list of the function names available on the object.
|
||
// Aliased as `methods`
|
||
_.functions = _.methods = function(obj) {
|
||
var names = [];
|
||
for (var key in obj) {
|
||
if (_.isFunction(obj[key])) names.push(key);
|
||
}
|
||
return names.sort();
|
||
};
|
||
|
||
// Extend a given object with all the properties in passed-in object(s).
|
||
_.extend = createAssigner(_.allKeys);
|
||
|
||
// Assigns a given object with all the own properties in the passed-in object(s)
|
||
// (https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/assign)
|
||
_.extendOwn = _.assign = createAssigner(_.keys);
|
||
|
||
// Returns the first key on an object that passes a predicate test
|
||
_.findKey = function(obj, predicate, context) {
|
||
predicate = cb(predicate, context);
|
||
var keys = _.keys(obj), key;
|
||
for (var i = 0, length = keys.length; i < length; i++) {
|
||
key = keys[i];
|
||
if (predicate(obj[key], key, obj)) return key;
|
||
}
|
||
};
|
||
|
||
// Return a copy of the object only containing the whitelisted properties.
|
||
_.pick = function(object, oiteratee, context) {
|
||
var result = {}, obj = object, iteratee, keys;
|
||
if (obj == null) return result;
|
||
if (_.isFunction(oiteratee)) {
|
||
keys = _.allKeys(obj);
|
||
iteratee = optimizeCb(oiteratee, context);
|
||
} else {
|
||
keys = flatten(arguments, false, false, 1);
|
||
iteratee = function(value, key, obj) { return key in obj; };
|
||
obj = Object(obj);
|
||
}
|
||
for (var i = 0, length = keys.length; i < length; i++) {
|
||
var key = keys[i];
|
||
var value = obj[key];
|
||
if (iteratee(value, key, obj)) result[key] = value;
|
||
}
|
||
return result;
|
||
};
|
||
|
||
// Return a copy of the object without the blacklisted properties.
|
||
_.omit = function(obj, iteratee, context) {
|
||
if (_.isFunction(iteratee)) {
|
||
iteratee = _.negate(iteratee);
|
||
} else {
|
||
var keys = _.map(flatten(arguments, false, false, 1), String);
|
||
iteratee = function(value, key) {
|
||
return !_.contains(keys, key);
|
||
};
|
||
}
|
||
return _.pick(obj, iteratee, context);
|
||
};
|
||
|
||
// Fill in a given object with default properties.
|
||
_.defaults = createAssigner(_.allKeys, true);
|
||
|
||
// Creates an object that inherits from the given prototype object.
|
||
// If additional properties are provided then they will be added to the
|
||
// created object.
|
||
_.create = function(prototype, props) {
|
||
var result = baseCreate(prototype);
|
||
if (props) _.extendOwn(result, props);
|
||
return result;
|
||
};
|
||
|
||
// Create a (shallow-cloned) duplicate of an object.
|
||
_.clone = function(obj) {
|
||
if (!_.isObject(obj)) return obj;
|
||
return _.isArray(obj) ? obj.slice() : _.extend({}, obj);
|
||
};
|
||
|
||
// Invokes interceptor with the obj, and then returns obj.
|
||
// The primary purpose of this method is to "tap into" a method chain, in
|
||
// order to perform operations on intermediate results within the chain.
|
||
_.tap = function(obj, interceptor) {
|
||
interceptor(obj);
|
||
return obj;
|
||
};
|
||
|
||
// Returns whether an object has a given set of `key:value` pairs.
|
||
_.isMatch = function(object, attrs) {
|
||
var keys = _.keys(attrs), length = keys.length;
|
||
if (object == null) return !length;
|
||
var obj = Object(object);
|
||
for (var i = 0; i < length; i++) {
|
||
var key = keys[i];
|
||
if (attrs[key] !== obj[key] || !(key in obj)) return false;
|
||
}
|
||
return true;
|
||
};
|
||
|
||
|
||
// Internal recursive comparison function for `isEqual`.
|
||
var eq = function(a, b, aStack, bStack) {
|
||
// Identical objects are equal. `0 === -0`, but they aren't identical.
|
||
// See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal).
|
||
if (a === b) return a !== 0 || 1 / a === 1 / b;
|
||
// A strict comparison is necessary because `null == undefined`.
|
||
if (a == null || b == null) return a === b;
|
||
// Unwrap any wrapped objects.
|
||
if (a instanceof _) a = a._wrapped;
|
||
if (b instanceof _) b = b._wrapped;
|
||
// Compare `[[Class]]` names.
|
||
var className = toString.call(a);
|
||
if (className !== toString.call(b)) return false;
|
||
switch (className) {
|
||
// Strings, numbers, regular expressions, dates, and booleans are compared by value.
|
||
case '[object RegExp]':
|
||
// RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i')
|
||
case '[object String]':
|
||
// Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is
|
||
// equivalent to `new String("5")`.
|
||
return '' + a === '' + b;
|
||
case '[object Number]':
|
||
// `NaN`s are equivalent, but non-reflexive.
|
||
// Object(NaN) is equivalent to NaN
|
||
if (+a !== +a) return +b !== +b;
|
||
// An `egal` comparison is performed for other numeric values.
|
||
return +a === 0 ? 1 / +a === 1 / b : +a === +b;
|
||
case '[object Date]':
|
||
case '[object Boolean]':
|
||
// Coerce dates and booleans to numeric primitive values. Dates are compared by their
|
||
// millisecond representations. Note that invalid dates with millisecond representations
|
||
// of `NaN` are not equivalent.
|
||
return +a === +b;
|
||
}
|
||
|
||
var areArrays = className === '[object Array]';
|
||
if (!areArrays) {
|
||
if (typeof a != 'object' || typeof b != 'object') return false;
|
||
|
||
// Objects with different constructors are not equivalent, but `Object`s or `Array`s
|
||
// from different frames are.
|
||
var aCtor = a.constructor, bCtor = b.constructor;
|
||
if (aCtor !== bCtor && !(_.isFunction(aCtor) && aCtor instanceof aCtor &&
|
||
_.isFunction(bCtor) && bCtor instanceof bCtor)
|
||
&& ('constructor' in a && 'constructor' in b)) {
|
||
return false;
|
||
}
|
||
}
|
||
// Assume equality for cyclic structures. The algorithm for detecting cyclic
|
||
// structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.
|
||
|
||
// Initializing stack of traversed objects.
|
||
// It's done here since we only need them for objects and arrays comparison.
|
||
aStack = aStack || [];
|
||
bStack = bStack || [];
|
||
var length = aStack.length;
|
||
while (length--) {
|
||
// Linear search. Performance is inversely proportional to the number of
|
||
// unique nested structures.
|
||
if (aStack[length] === a) return bStack[length] === b;
|
||
}
|
||
|
||
// Add the first object to the stack of traversed objects.
|
||
aStack.push(a);
|
||
bStack.push(b);
|
||
|
||
// Recursively compare objects and arrays.
|
||
if (areArrays) {
|
||
// Compare array lengths to determine if a deep comparison is necessary.
|
||
length = a.length;
|
||
if (length !== b.length) return false;
|
||
// Deep compare the contents, ignoring non-numeric properties.
|
||
while (length--) {
|
||
if (!eq(a[length], b[length], aStack, bStack)) return false;
|
||
}
|
||
} else {
|
||
// Deep compare objects.
|
||
var keys = _.keys(a), key;
|
||
length = keys.length;
|
||
// Ensure that both objects contain the same number of properties before comparing deep equality.
|
||
if (_.keys(b).length !== length) return false;
|
||
while (length--) {
|
||
// Deep compare each member
|
||
key = keys[length];
|
||
if (!(_.has(b, key) && eq(a[key], b[key], aStack, bStack))) return false;
|
||
}
|
||
}
|
||
// Remove the first object from the stack of traversed objects.
|
||
aStack.pop();
|
||
bStack.pop();
|
||
return true;
|
||
};
|
||
|
||
// Perform a deep comparison to check if two objects are equal.
|
||
_.isEqual = function(a, b) {
|
||
return eq(a, b);
|
||
};
|
||
|
||
// Is a given array, string, or object empty?
|
||
// An "empty" object has no enumerable own-properties.
|
||
_.isEmpty = function(obj) {
|
||
if (obj == null) return true;
|
||
if (isArrayLike(obj) && (_.isArray(obj) || _.isString(obj) || _.isArguments(obj))) return obj.length === 0;
|
||
return _.keys(obj).length === 0;
|
||
};
|
||
|
||
// Is a given value a DOM element?
|
||
_.isElement = function(obj) {
|
||
return !!(obj && obj.nodeType === 1);
|
||
};
|
||
|
||
// Is a given value an array?
|
||
// Delegates to ECMA5's native Array.isArray
|
||
_.isArray = nativeIsArray || function(obj) {
|
||
return toString.call(obj) === '[object Array]';
|
||
};
|
||
|
||
// Is a given variable an object?
|
||
_.isObject = function(obj) {
|
||
var type = typeof obj;
|
||
return type === 'function' || type === 'object' && !!obj;
|
||
};
|
||
|
||
// Add some isType methods: isArguments, isFunction, isString, isNumber, isDate, isRegExp, isError.
|
||
_.each(['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp', 'Error'], function(name) {
|
||
_['is' + name] = function(obj) {
|
||
return toString.call(obj) === '[object ' + name + ']';
|
||
};
|
||
});
|
||
|
||
// Define a fallback version of the method in browsers (ahem, IE < 9), where
|
||
// there isn't any inspectable "Arguments" type.
|
||
if (!_.isArguments(arguments)) {
|
||
_.isArguments = function(obj) {
|
||
return _.has(obj, 'callee');
|
||
};
|
||
}
|
||
|
||
// Optimize `isFunction` if appropriate. Work around some typeof bugs in old v8,
|
||
// IE 11 (#1621), and in Safari 8 (#1929).
|
||
if (typeof /./ != 'function' && typeof Int8Array != 'object') {
|
||
_.isFunction = function(obj) {
|
||
return typeof obj == 'function' || false;
|
||
};
|
||
}
|
||
|
||
// Is a given object a finite number?
|
||
_.isFinite = function(obj) {
|
||
return isFinite(obj) && !isNaN(parseFloat(obj));
|
||
};
|
||
|
||
// Is the given value `NaN`? (NaN is the only number which does not equal itself).
|
||
_.isNaN = function(obj) {
|
||
return _.isNumber(obj) && obj !== +obj;
|
||
};
|
||
|
||
// Is a given value a boolean?
|
||
_.isBoolean = function(obj) {
|
||
return obj === true || obj === false || toString.call(obj) === '[object Boolean]';
|
||
};
|
||
|
||
// Is a given value equal to null?
|
||
_.isNull = function(obj) {
|
||
return obj === null;
|
||
};
|
||
|
||
// Is a given variable undefined?
|
||
_.isUndefined = function(obj) {
|
||
return obj === void 0;
|
||
};
|
||
|
||
// Shortcut function for checking if an object has a given property directly
|
||
// on itself (in other words, not on a prototype).
|
||
_.has = function(obj, key) {
|
||
return obj != null && hasOwnProperty.call(obj, key);
|
||
};
|
||
|
||
// Utility Functions
|
||
// -----------------
|
||
|
||
// Run Underscore.js in *noConflict* mode, returning the `_` variable to its
|
||
// previous owner. Returns a reference to the Underscore object.
|
||
_.noConflict = function() {
|
||
root._ = previousUnderscore;
|
||
return this;
|
||
};
|
||
|
||
// Keep the identity function around for default iteratees.
|
||
_.identity = function(value) {
|
||
return value;
|
||
};
|
||
|
||
// Predicate-generating functions. Often useful outside of Underscore.
|
||
_.constant = function(value) {
|
||
return function() {
|
||
return value;
|
||
};
|
||
};
|
||
|
||
_.noop = function(){};
|
||
|
||
_.property = property;
|
||
|
||
// Generates a function for a given object that returns a given property.
|
||
_.propertyOf = function(obj) {
|
||
return obj == null ? function(){} : function(key) {
|
||
return obj[key];
|
||
};
|
||
};
|
||
|
||
// Returns a predicate for checking whether an object has a given set of
|
||
// `key:value` pairs.
|
||
_.matcher = _.matches = function(attrs) {
|
||
attrs = _.extendOwn({}, attrs);
|
||
return function(obj) {
|
||
return _.isMatch(obj, attrs);
|
||
};
|
||
};
|
||
|
||
// Run a function **n** times.
|
||
_.times = function(n, iteratee, context) {
|
||
var accum = Array(Math.max(0, n));
|
||
iteratee = optimizeCb(iteratee, context, 1);
|
||
for (var i = 0; i < n; i++) accum[i] = iteratee(i);
|
||
return accum;
|
||
};
|
||
|
||
// Return a random integer between min and max (inclusive).
|
||
_.random = function(min, max) {
|
||
if (max == null) {
|
||
max = min;
|
||
min = 0;
|
||
}
|
||
return min + Math.floor(Math.random() * (max - min + 1));
|
||
};
|
||
|
||
// A (possibly faster) way to get the current timestamp as an integer.
|
||
_.now = Date.now || function() {
|
||
return new Date().getTime();
|
||
};
|
||
|
||
// List of HTML entities for escaping.
|
||
var escapeMap = {
|
||
'&': '&',
|
||
'<': '<',
|
||
'>': '>',
|
||
'"': '"',
|
||
"'": ''',
|
||
'`': '`'
|
||
};
|
||
var unescapeMap = _.invert(escapeMap);
|
||
|
||
// Functions for escaping and unescaping strings to/from HTML interpolation.
|
||
var createEscaper = function(map) {
|
||
var escaper = function(match) {
|
||
return map[match];
|
||
};
|
||
// Regexes for identifying a key that needs to be escaped
|
||
var source = '(?:' + _.keys(map).join('|') + ')';
|
||
var testRegexp = RegExp(source);
|
||
var replaceRegexp = RegExp(source, 'g');
|
||
return function(string) {
|
||
string = string == null ? '' : '' + string;
|
||
return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;
|
||
};
|
||
};
|
||
_.escape = createEscaper(escapeMap);
|
||
_.unescape = createEscaper(unescapeMap);
|
||
|
||
// If the value of the named `property` is a function then invoke it with the
|
||
// `object` as context; otherwise, return it.
|
||
_.result = function(object, property, fallback) {
|
||
var value = object == null ? void 0 : object[property];
|
||
if (value === void 0) {
|
||
value = fallback;
|
||
}
|
||
return _.isFunction(value) ? value.call(object) : value;
|
||
};
|
||
|
||
// Generate a unique integer id (unique within the entire client session).
|
||
// Useful for temporary DOM ids.
|
||
var idCounter = 0;
|
||
_.uniqueId = function(prefix) {
|
||
var id = ++idCounter + '';
|
||
return prefix ? prefix + id : id;
|
||
};
|
||
|
||
// By default, Underscore uses ERB-style template delimiters, change the
|
||
// following template settings to use alternative delimiters.
|
||
_.templateSettings = {
|
||
evaluate : /<%([\s\S]+?)%>/g,
|
||
interpolate : /<%=([\s\S]+?)%>/g,
|
||
escape : /<%-([\s\S]+?)%>/g
|
||
};
|
||
|
||
// When customizing `templateSettings`, if you don't want to define an
|
||
// interpolation, evaluation or escaping regex, we need one that is
|
||
// guaranteed not to match.
|
||
var noMatch = /(.)^/;
|
||
|
||
// Certain characters need to be escaped so that they can be put into a
|
||
// string literal.
|
||
var escapes = {
|
||
"'": "'",
|
||
'\\': '\\',
|
||
'\r': 'r',
|
||
'\n': 'n',
|
||
'\u2028': 'u2028',
|
||
'\u2029': 'u2029'
|
||
};
|
||
|
||
var escaper = /\\|'|\r|\n|\u2028|\u2029/g;
|
||
|
||
var escapeChar = function(match) {
|
||
return '\\' + escapes[match];
|
||
};
|
||
|
||
// JavaScript micro-templating, similar to John Resig's implementation.
|
||
// Underscore templating handles arbitrary delimiters, preserves whitespace,
|
||
// and correctly escapes quotes within interpolated code.
|
||
// NB: `oldSettings` only exists for backwards compatibility.
|
||
_.template = function(text, settings, oldSettings) {
|
||
if (!settings && oldSettings) settings = oldSettings;
|
||
settings = _.defaults({}, settings, _.templateSettings);
|
||
|
||
// Combine delimiters into one regular expression via alternation.
|
||
var matcher = RegExp([
|
||
(settings.escape || noMatch).source,
|
||
(settings.interpolate || noMatch).source,
|
||
(settings.evaluate || noMatch).source
|
||
].join('|') + '|$', 'g');
|
||
|
||
// Compile the template source, escaping string literals appropriately.
|
||
var index = 0;
|
||
var source = "__p+='";
|
||
text.replace(matcher, function(match, escape, interpolate, evaluate, offset) {
|
||
source += text.slice(index, offset).replace(escaper, escapeChar);
|
||
index = offset + match.length;
|
||
|
||
if (escape) {
|
||
source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'";
|
||
} else if (interpolate) {
|
||
source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'";
|
||
} else if (evaluate) {
|
||
source += "';\n" + evaluate + "\n__p+='";
|
||
}
|
||
|
||
// Adobe VMs need the match returned to produce the correct offest.
|
||
return match;
|
||
});
|
||
source += "';\n";
|
||
|
||
// If a variable is not specified, place data values in local scope.
|
||
if (!settings.variable) source = 'with(obj||{}){\n' + source + '}\n';
|
||
|
||
source = "var __t,__p='',__j=Array.prototype.join," +
|
||
"print=function(){__p+=__j.call(arguments,'');};\n" +
|
||
source + 'return __p;\n';
|
||
|
||
try {
|
||
var render = new Function(settings.variable || 'obj', '_', source);
|
||
} catch (e) {
|
||
e.source = source;
|
||
throw e;
|
||
}
|
||
|
||
var template = function(data) {
|
||
return render.call(this, data, _);
|
||
};
|
||
|
||
// Provide the compiled source as a convenience for precompilation.
|
||
var argument = settings.variable || 'obj';
|
||
template.source = 'function(' + argument + '){\n' + source + '}';
|
||
|
||
return template;
|
||
};
|
||
|
||
// Add a "chain" function. Start chaining a wrapped Underscore object.
|
||
_.chain = function(obj) {
|
||
var instance = _(obj);
|
||
instance._chain = true;
|
||
return instance;
|
||
};
|
||
|
||
// OOP
|
||
// ---------------
|
||
// If Underscore is called as a function, it returns a wrapped object that
|
||
// can be used OO-style. This wrapper holds altered versions of all the
|
||
// underscore functions. Wrapped objects may be chained.
|
||
|
||
// Helper function to continue chaining intermediate results.
|
||
var result = function(instance, obj) {
|
||
return instance._chain ? _(obj).chain() : obj;
|
||
};
|
||
|
||
// Add your own custom functions to the Underscore object.
|
||
_.mixin = function(obj) {
|
||
_.each(_.functions(obj), function(name) {
|
||
var func = _[name] = obj[name];
|
||
_.prototype[name] = function() {
|
||
var args = [this._wrapped];
|
||
push.apply(args, arguments);
|
||
return result(this, func.apply(_, args));
|
||
};
|
||
});
|
||
};
|
||
|
||
// Add all of the Underscore functions to the wrapper object.
|
||
_.mixin(_);
|
||
|
||
// Add all mutator Array functions to the wrapper.
|
||
_.each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) {
|
||
var method = ArrayProto[name];
|
||
_.prototype[name] = function() {
|
||
var obj = this._wrapped;
|
||
method.apply(obj, arguments);
|
||
if ((name === 'shift' || name === 'splice') && obj.length === 0) delete obj[0];
|
||
return result(this, obj);
|
||
};
|
||
});
|
||
|
||
// Add all accessor Array functions to the wrapper.
|
||
_.each(['concat', 'join', 'slice'], function(name) {
|
||
var method = ArrayProto[name];
|
||
_.prototype[name] = function() {
|
||
return result(this, method.apply(this._wrapped, arguments));
|
||
};
|
||
});
|
||
|
||
// Extracts the result from a wrapped and chained object.
|
||
_.prototype.value = function() {
|
||
return this._wrapped;
|
||
};
|
||
|
||
// Provide unwrapping proxy for some methods used in engine operations
|
||
// such as arithmetic and JSON stringification.
|
||
_.prototype.valueOf = _.prototype.toJSON = _.prototype.value;
|
||
|
||
_.prototype.toString = function() {
|
||
return '' + this._wrapped;
|
||
};
|
||
|
||
// AMD registration happens at the end for compatibility with AMD loaders
|
||
// that may not enforce next-turn semantics on modules. Even though general
|
||
// practice for AMD registration is to be anonymous, underscore registers
|
||
// as a named module because, like jQuery, it is a base library that is
|
||
// popular enough to be bundled in a third party lib, but not be part of
|
||
// an AMD load request. Those cases could generate an error when an
|
||
// anonymous define() is called outside of a loader request.
|
||
if (typeof define === 'function' && define.amd) {
|
||
define('underscore', [], function() {
|
||
return _;
|
||
});
|
||
}
|
||
}.call(this));
|
||
|
||
},{}],13:[function(require,module,exports){
|
||
"use strict";
|
||
|
||
var Battleside = require("./Battleside");
|
||
var Card = require("./Card");
|
||
var shortid = require("shortid");
|
||
|
||
var Battle = (function () {
|
||
var Battle = function Battle(id, p1, p2, socket) {
|
||
if (!(this instanceof Battle)) {
|
||
return new Battle(id, p1, p2, socket);
|
||
}
|
||
/**
|
||
* constructor here
|
||
*/
|
||
this.events = {};
|
||
this._id = id;
|
||
this._user1 = p1;
|
||
this._user2 = p2;
|
||
this.socket = socket;
|
||
this.channel = {};
|
||
};
|
||
var r = Battle.prototype;
|
||
/**
|
||
* methods && properties here
|
||
* r.property = null;
|
||
* r.getProperty = function() {...}
|
||
*/
|
||
|
||
r.p1 = null;
|
||
r.p2 = null;
|
||
r._user1 = null;
|
||
r._user2 = null;
|
||
r.turn = 0;
|
||
|
||
r.socket = null;
|
||
r.channel = null;
|
||
|
||
r._id = null;
|
||
|
||
r.events = null;
|
||
|
||
r.init = function () {
|
||
/*PubSub.subscribe("update", this.update.bind(this));*/
|
||
this.on("Update", this.update);
|
||
/*
|
||
this.on("AfterPlace", this.checkAbilityOnAfterPlace)*/
|
||
|
||
this.channel = this.socket.subscribe(this._id);
|
||
this.p1 = Battleside(this._user1.getName(), 0, this, this._user1);
|
||
this.p2 = Battleside(this._user2.getName(), 1, this, this._user2);
|
||
this.p1.foe = this.p2;
|
||
this.p2.foe = this.p1;
|
||
this.p1.setUpWeatherFieldWith(this.p2);
|
||
|
||
this.start();
|
||
};
|
||
|
||
r.start = function () {
|
||
this.p1.setLeadercard();
|
||
this.p2.setLeadercard();
|
||
this.p1.draw(5);
|
||
this.p2.draw(5);
|
||
|
||
this.p1.hand.add(Card("kaedweni_siege_expert"));
|
||
this.p2.hand.add(Card("kaedweni_siege_expert"));
|
||
this.p1.hand.add(Card("ballista"));
|
||
this.p2.hand.add(Card("ballista"));
|
||
this.p1.hand.add(Card("ballista"));
|
||
this.p2.hand.add(Card("ballista"));
|
||
this.p1.hand.add(Card("ballista"));
|
||
this.p2.hand.add(Card("ballista"));
|
||
this.p1.hand.add(Card("ballista"));
|
||
this.p2.hand.add(Card("ballista"));
|
||
this.p1.hand.add(Card("ballista"));
|
||
this.p2.hand.add(Card("ballista"));
|
||
this.p1.hand.add(Card("decoy"));
|
||
this.p2.hand.add(Card("decoy"));
|
||
/*
|
||
this.p1.hand.add(Card("dun_banner_medic"));
|
||
this.p2.hand.add(Card("dun_banner_medic"));
|
||
this.p1.hand.add(Card("isengrim_faoiltiarnah"));
|
||
this.p2.hand.add(Card("isengrim_faoiltiarnah"));*/
|
||
|
||
/*this.p1.addToDiscard([Card("kaedweni_siege_expert")]);
|
||
this.p2.addToDiscard([Card("kaedweni_siege_expert")]);*/
|
||
/*
|
||
this.p1.hand.add(Card("decoy"));
|
||
this.p1.hand.add(Card("impenetrable_fog"));
|
||
this.p2.hand.add(Card("decoy"));
|
||
this.p2.hand.add(Card("impenetrable_fog"));*/
|
||
|
||
this.update();
|
||
|
||
/*PubSub.subscribe("nextTurn", this.switchTurn.bind(this));*/
|
||
this.on("NextTurn", this.switchTurn);
|
||
|
||
this.switchTurn(Math.random() > 0.5 ? this.p1 : this.p2);
|
||
};
|
||
|
||
r.switchTurn = function (side, __flag) {
|
||
__flag = typeof __flag == "undefined" ? 0 : 1;
|
||
|
||
if (!(side instanceof Battleside)) {
|
||
console.trace("side is not a battleside!");
|
||
return;
|
||
}
|
||
if (side.isPassing()) {
|
||
if (__flag) {
|
||
return this.startNextRound();
|
||
}
|
||
return this.switchTurn(side.foe, 1);
|
||
}
|
||
|
||
this.runEvent("EachTurn");
|
||
this.runEvent("Turn" + side.getID());
|
||
console.log("current Turn: ", side.getName());
|
||
};
|
||
|
||
r.startNextRound = function () {
|
||
var loser = this.checkRubies();
|
||
if (this.checkIfIsOver()) {
|
||
console.log("its over!");
|
||
this.update();
|
||
return;
|
||
}
|
||
|
||
this.p1.resetNewRound();
|
||
this.p2.resetNewRound();
|
||
|
||
console.log("start new round!");
|
||
|
||
this.update();
|
||
this.switchTurn(loser);
|
||
};
|
||
|
||
r.update = function () {
|
||
this._update(this.p1);
|
||
this._update(this.p2);
|
||
};
|
||
|
||
r._update = function (p) {
|
||
p.send("update:info", {
|
||
info: p.getInfo(),
|
||
leader: p.field[Card.TYPE.LEADER].get()[0]
|
||
});
|
||
p.send("update:hand", {
|
||
cards: JSON.stringify(p.hand.getCards())
|
||
});
|
||
p.send("update:fields", {
|
||
close: p.field[Card.TYPE.CLOSE_COMBAT],
|
||
ranged: p.field[Card.TYPE.RANGED],
|
||
siege: p.field[Card.TYPE.SIEGE],
|
||
weather: p.field[Card.TYPE.WEATHER]
|
||
});
|
||
};
|
||
|
||
r.send = function (event, data) {
|
||
this.channel.publish({
|
||
event: event,
|
||
data: data
|
||
});
|
||
};
|
||
|
||
r.runEvent = function (eventid, ctx, args, uid) {
|
||
ctx = ctx || this;
|
||
uid = uid || null;
|
||
args = args || [];
|
||
var event = "on" + eventid;
|
||
|
||
if (!this.events[event]) {
|
||
return;
|
||
}
|
||
|
||
if (uid) {
|
||
var obj = this.events[event][uid];
|
||
obj.cb = obj.cb.bind(ctx);
|
||
obj.cb.apply(ctx, obj.onArgs.concat(args));
|
||
} else {
|
||
for (var _uid in this.events[event]) {
|
||
var obj = this.events[event][_uid];
|
||
obj.cb = obj.cb.bind(ctx);
|
||
obj.cb.apply(ctx, obj.onArgs.concat(args));
|
||
}
|
||
}
|
||
this.update();
|
||
};
|
||
|
||
r.on = function (eventid, cb, ctx, args) {
|
||
ctx = ctx || null;
|
||
args = args || [];
|
||
var event = "on" + eventid;
|
||
var uid_event = shortid.generate();
|
||
|
||
var obj = {};
|
||
if (!ctx) {
|
||
obj.cb = cb;
|
||
} else {
|
||
obj.cb = cb.bind(ctx);
|
||
}
|
||
obj.onArgs = args;
|
||
|
||
if (!(event in this.events)) {
|
||
/*this.events[event] = [];*/
|
||
this.events[event] = {};
|
||
}
|
||
|
||
if (typeof cb !== "function") {
|
||
throw new Error("cb not a function");
|
||
}
|
||
|
||
this.events[event][uid_event] = obj;
|
||
|
||
return uid_event;
|
||
};
|
||
|
||
r.off = function (eventid, uid) {
|
||
uid = uid || null;
|
||
var event = "on" + eventid;
|
||
if (!this.events[event]) return;
|
||
if (uid) {
|
||
this.events[event][uid] = null;
|
||
delete this.events[event][uid];
|
||
return;
|
||
}
|
||
for (var _uid in this.events[event]) {
|
||
this.events[event][_uid] = null;
|
||
delete this.events[event][_uid];
|
||
}
|
||
};
|
||
|
||
r.checkIfIsOver = function () {
|
||
return !(this.p1.getRubies() && this.p2.getRubies());
|
||
};
|
||
|
||
r.checkRubies = function () {
|
||
var scoreP1 = this.p1.getScore();
|
||
var scoreP2 = this.p2.getScore();
|
||
|
||
if (scoreP1 > scoreP2) {
|
||
this.p2.removeRuby();
|
||
return this.p2;
|
||
}
|
||
if (scoreP2 > scoreP1) {
|
||
this.p1.removeRuby();
|
||
return this.p1;
|
||
}
|
||
|
||
//tie
|
||
this.p1.removeRuby();
|
||
this.p2.removeRuby();
|
||
return Math.random() > 0.5 ? this.p1 : this.p2;
|
||
};
|
||
|
||
r.userLeft = function (sideName) {
|
||
var side = this[sideName];
|
||
|
||
side.foe.send("foe:left", null, true);
|
||
};
|
||
|
||
r.shutDown = function () {
|
||
this.channel = null;
|
||
};
|
||
|
||
return Battle;
|
||
})();
|
||
|
||
module.exports = Battle;
|
||
|
||
},{"./Battleside":14,"./Card":15,"shortid":7}],14:[function(require,module,exports){
|
||
"use strict";
|
||
|
||
var DeckData = require("../assets/data/deck");
|
||
var Deck = require("./Deck");
|
||
var Hand = require("./Hand");
|
||
var Card = require("./Card");
|
||
var Field = require("./Field");
|
||
var _ = require("underscore");
|
||
|
||
var Battleside;
|
||
Battleside = (function () {
|
||
var Battleside = function Battleside(name, n, battle, user) {
|
||
if (!(this instanceof Battleside)) {
|
||
return new Battleside(name, n, battle, user);
|
||
}
|
||
/**
|
||
* constructor here
|
||
*/
|
||
|
||
var deck = user.getDeck();
|
||
var self = this;
|
||
this._isWaiting = true;
|
||
this.socket = user.socket;
|
||
this.field = {};
|
||
this.field[Card.TYPE.LEADER] = Field(Card.TYPE.LEADER);
|
||
this.field[Card.TYPE.CLOSE_COMBAT] = Field(Card.TYPE.CLOSE_COMBAT);
|
||
this.field[Card.TYPE.RANGED] = Field(Card.TYPE.RANGED);
|
||
this.field[Card.TYPE.SIEGE] = Field(Card.TYPE.SIEGE);
|
||
this.n = n ? "p2" : "p1";
|
||
this._name = name;
|
||
this.battle = battle;
|
||
this.hand = Hand();
|
||
this.deck = Deck(DeckData[deck]);
|
||
this._discard = [];
|
||
|
||
this.runEvent = this.battle.runEvent.bind(this.battle);
|
||
this.on = this.battle.on.bind(this.battle);
|
||
this.off = this.battle.off.bind(this.battle);
|
||
|
||
this.receive("activate:leader", function () {
|
||
if (self._isWaiting) return;
|
||
if (self.isPassing()) return;
|
||
|
||
console.log("leader activated");
|
||
|
||
var leaderCard = self.getLeader();
|
||
if (leaderCard.isDisabled()) return;
|
||
|
||
var ability = leaderCard.getAbility();
|
||
|
||
ability.onActivate.apply(self);
|
||
leaderCard.setDisabled(true);
|
||
self.update();
|
||
});
|
||
this.receive("play:cardFromHand", function (data) {
|
||
if (self._isWaiting) return;
|
||
if (self.isPassing()) return;
|
||
var cardID = data.id;
|
||
var card = self.hand.getCard(cardID);
|
||
|
||
self.playCard(card);
|
||
});
|
||
this.receive("decoy:replaceWith", function (data) {
|
||
if (self._isWaiting) return;
|
||
var card = self.findCardOnFieldByID(data.cardID);
|
||
if (card === -1) throw new Error("decoy:replace | unknown card");
|
||
self.runEvent("Decoy:replaceWith", self, [card]);
|
||
});
|
||
this.receive("cancel:decoy", function () {
|
||
self.off("Decoy:replaceWith");
|
||
});
|
||
this.receive("set:passing", function () {
|
||
self.setPassing(true);
|
||
self.update();
|
||
self.runEvent("NextTurn", null, [self.foe]);
|
||
});
|
||
this.receive("medic:chooseCardFromDiscard", function (data) {
|
||
if (!data) {
|
||
self.runEvent("NextTurn", null, [self.foe]);
|
||
return;
|
||
}
|
||
var cardID = data.cardID;
|
||
var card = self.getCardFromDiscard(cardID);
|
||
if (card === -1) throw new Error("medic:chooseCardFromDiscard | unknown card: ", card);
|
||
|
||
self.removeFromDiscard(card);
|
||
|
||
self.playCard(card);
|
||
});
|
||
this.receive("agile:field", function (data) {
|
||
var fieldType = data.field;
|
||
self.runEvent("agile:setField", null, [fieldType]);
|
||
self.runEvent("NextTurn", null, [self.foe]);
|
||
});
|
||
this.receive("cancel:agile", function () {
|
||
self.off("agile:setField");
|
||
});
|
||
|
||
this.on("Turn" + this.getID(), this.onTurnStart, this);
|
||
};
|
||
var r = Battleside.prototype;
|
||
/**
|
||
* methods && properties here
|
||
* r.property = null;
|
||
* r.getProperty = function() {...}
|
||
*/
|
||
r._name = null;
|
||
r._discard = null;
|
||
|
||
r._rubies = 2;
|
||
r._score = 0;
|
||
r._isWaiting = null;
|
||
r._passing = null;
|
||
|
||
r.field = null;
|
||
|
||
r.socket = null;
|
||
r.n = null;
|
||
|
||
r.foe = null;
|
||
r.hand = null;
|
||
r.battle = null;
|
||
r.deck = null;
|
||
|
||
r.isPassing = function () {
|
||
return this._passing;
|
||
};
|
||
|
||
r.setUpWeatherFieldWith = function (p2) {
|
||
this.field[Card.TYPE.WEATHER] = p2.field[Card.TYPE.WEATHER] = Field(Card.TYPE.WEATHER);
|
||
};
|
||
|
||
r.findCardOnFieldByID = function (id) {
|
||
for (var key in this.field) {
|
||
var field = this.field[key];
|
||
var card = field.getCard(id);
|
||
if (card !== -1) return card;
|
||
}
|
||
/*
|
||
for(var i = 0; i < this._discard.length; i++) {
|
||
var c = this._discard[i];
|
||
if(c.getID() === id) return c;
|
||
}*/
|
||
return -1;
|
||
};
|
||
|
||
r.getCardFromDiscard = function (id) {
|
||
for (var i = 0; i < this._discard.length; i++) {
|
||
var c = this._discard[i];
|
||
if (c.getID() === id) return c;
|
||
}
|
||
return -1;
|
||
};
|
||
|
||
r.setPassing = function (b) {
|
||
this._passing = b;
|
||
this.send("set:passing", { passing: this._passing }, true);
|
||
};
|
||
|
||
r.wait = function () {
|
||
this._isWaiting = true;
|
||
this.send("set:waiting", { waiting: this._isWaiting }, true);
|
||
};
|
||
|
||
r.turn = function () {
|
||
this._isWaiting = false;
|
||
this.send("set:waiting", { waiting: this._isWaiting }, true);
|
||
};
|
||
|
||
r.setLeadercard = function () {
|
||
var leaderCard = this.deck.find("type", Card.TYPE.LEADER);
|
||
this.deck.removeFromDeck(leaderCard[0]);
|
||
/*
|
||
this.getYourside().setField("leader", leaderCard[0]);*/
|
||
this.field[Card.TYPE.LEADER].add(leaderCard[0]);
|
||
};
|
||
|
||
r.getLeader = function () {
|
||
return this.field[Card.TYPE.LEADER].get()[0];
|
||
};
|
||
|
||
r.getID = function () {
|
||
return this.n;
|
||
};
|
||
|
||
r.draw = function (times) {
|
||
while (times--) {
|
||
var card = this.deck.draw();
|
||
this.hand.add(card);
|
||
}
|
||
|
||
console.log("update:hand fired");
|
||
|
||
this.update();
|
||
};
|
||
|
||
r.calcScore = function () {
|
||
var score = 0;
|
||
for (var key in this.field) {
|
||
score += +this.field[key].getScore();
|
||
}
|
||
return this._score = score;
|
||
};
|
||
|
||
r.getInfo = function () {
|
||
return {
|
||
name: this.getName(),
|
||
lives: this._rubies,
|
||
score: this.calcScore(),
|
||
hand: this.hand.length(),
|
||
discard: this.getDiscard(true),
|
||
passing: this._passing
|
||
};
|
||
};
|
||
|
||
r.getRubies = function () {
|
||
return this._rubies;
|
||
};
|
||
|
||
r.getScore = function () {
|
||
return +this.calcScore();
|
||
};
|
||
|
||
r.removeRuby = function () {
|
||
this._rubies--;
|
||
};
|
||
|
||
r.getName = function () {
|
||
return this._name;
|
||
};
|
||
|
||
r.send = function (event, msg, isPrivate) {
|
||
msg = msg || {};
|
||
isPrivate = typeof isPrivate === "undefined" ? false : isPrivate;
|
||
msg._roomSide = this.n;
|
||
|
||
if (isPrivate) {
|
||
return this.socket.emit(event, msg);
|
||
}
|
||
this.battle.send(event, msg);
|
||
};
|
||
|
||
r.receive = function (event, cb) {
|
||
this.socket.on(event, cb);
|
||
};
|
||
|
||
r.update = function () {
|
||
//PubSub.publish("update");
|
||
this.runEvent("Update");
|
||
};
|
||
|
||
r.onTurnStart = function () {
|
||
this.foe.wait();
|
||
this.turn();
|
||
|
||
//wait for cardplay event
|
||
};
|
||
|
||
r.playCard = function (card) {
|
||
if (card === null || card === -1) return;
|
||
|
||
if (!this.placeCard(card)) return;
|
||
|
||
this.hand.remove(card);
|
||
|
||
this.update();
|
||
|
||
this.runEvent("NextTurn", null, [this.foe]);
|
||
};
|
||
|
||
r.placeCard = function (card, obj) {
|
||
obj = _.extend({}, obj);
|
||
|
||
this.checkAbilities(card, obj);
|
||
if (obj._cancelPlacement) return 0;
|
||
|
||
var field = obj.targetSide.field[card.getType()];
|
||
field.add(card);
|
||
|
||
this.runEvent("EachCardPlace");
|
||
|
||
this.checkAbilityOnAfterPlace(card, obj);
|
||
/*
|
||
this.runEvent("AfterPlace", this, [card, obj]);*/
|
||
|
||
this.update();
|
||
|
||
if (obj._waitResponse) {
|
||
this.hand.remove(card);
|
||
this.update();
|
||
return 0;
|
||
}
|
||
|
||
return 1;
|
||
};
|
||
|
||
r.checkAbilities = function (card, obj, __flag) {
|
||
var self = this;
|
||
obj.targetSide = this;
|
||
if (obj.disabled) return;
|
||
var ability = Array.isArray(__flag) || card.getAbility();
|
||
|
||
if (Array.isArray(ability) && ability.length) {
|
||
var ret = ability.slice();
|
||
ret = ret.splice(0, 1);
|
||
this.checkAbilities(card, obj, ret);
|
||
ability = ability[0];
|
||
}
|
||
|
||
if (ability && ability.name === obj.suppress) {
|
||
this.update();
|
||
}
|
||
|
||
if (ability && !Array.isArray(ability)) {
|
||
if (ability.onBeforePlace) {
|
||
ability.onBeforePlace.apply(this, [card]);
|
||
}
|
||
if (ability.cancelPlacement) {
|
||
obj._cancelPlacement = true;
|
||
}
|
||
if (ability.waitResponse) {
|
||
obj._waitResponse = true;
|
||
}
|
||
if (ability.changeSide) {
|
||
obj.targetSide = this.foe;
|
||
}
|
||
if (ability.onReset) {
|
||
this.on("Reset", ability.onReset, this, [card]);
|
||
}
|
||
if (ability.replaceWith) {
|
||
obj._cancelPlacement = true;
|
||
this.on("Decoy:replaceWith", function (replaceCard) {
|
||
if (replaceCard.getType() == Card.TYPE.LEADER || replaceCard.getType() == Card.TYPE.WEATHER || replaceCard.getType() == Card.TYPE.SPECIAL) {
|
||
return;
|
||
}
|
||
if (replaceCard.getName() === card.getName()) return;
|
||
self.off("Decoy:replaceWith");
|
||
var field = self.field[replaceCard.getType()];
|
||
|
||
field.replaceWith(replaceCard, card);
|
||
self.runEvent("EachCardPlace");
|
||
|
||
self.hand.add(replaceCard);
|
||
self.hand.remove(card);
|
||
self.update();
|
||
|
||
self.runEvent("NextTurn", null, [self.foe]);
|
||
});
|
||
}
|
||
if (ability.onEachTurn) {
|
||
var uid = this.on("EachTurn", ability.onEachTurn, this, [card]);
|
||
card._uidEvents["EachTurn"] = uid;
|
||
}
|
||
if (ability.onEachCardPlace) {
|
||
var uid = this.on("EachCardPlace", ability.onEachCardPlace, this, [card]);
|
||
card._uidEvents["EachCardPlace"] = uid;
|
||
}
|
||
|
||
this.update();
|
||
}
|
||
};
|
||
|
||
r.checkAbilityOnAfterPlace = function (card, obj) {
|
||
var ability = card.getAbility();
|
||
if (ability) {
|
||
if (ability.name && ability.name === obj.suppress) {
|
||
this.update();
|
||
return;
|
||
}
|
||
if (ability.onAfterPlace) {
|
||
ability.onAfterPlace.call(this, card);
|
||
}
|
||
}
|
||
};
|
||
|
||
r.clearMainFields = function () {
|
||
var cards1 = this.field[Card.TYPE.CLOSE_COMBAT].removeAll();
|
||
var cards2 = this.field[Card.TYPE.RANGED].removeAll();
|
||
var cards3 = this.field[Card.TYPE.SIEGE].removeAll();
|
||
|
||
var cards = cards1.concat(cards2.concat(cards3));
|
||
this.addToDiscard(cards);
|
||
};
|
||
|
||
r.addToDiscard = function (cards) {
|
||
var self = this;
|
||
cards.forEach(function (card) {
|
||
self._discard.push(card);
|
||
});
|
||
};
|
||
|
||
r.removeFromDiscard = function (card) {
|
||
for (var i = 0; i < this._discard.length; i++) {
|
||
var c = this._discard[i];
|
||
if (c.getID() === card.getID()) {
|
||
|
||
this._discard.splice(i, 1);
|
||
return;
|
||
}
|
||
}
|
||
};
|
||
|
||
r.getDiscard = function (json) {
|
||
if (json) {
|
||
return JSON.stringify(this._discard);
|
||
}
|
||
return this._discard;
|
||
};
|
||
|
||
r.resetNewRound = function () {
|
||
this.clearMainFields();
|
||
this.setPassing(false);
|
||
};
|
||
|
||
r.filter = function (arrCards, opt) {
|
||
var arr = arrCards.slice();
|
||
|
||
for (var key in opt) {
|
||
var res = [];
|
||
var prop = key,
|
||
val = opt[key];
|
||
|
||
arrCards.forEach(function (card) {
|
||
var property = card.getProperty(prop);
|
||
if (_.isArray(property)) {
|
||
var _f = false;
|
||
for (var i = 0; i < property.length; i++) {
|
||
if (property[i] === val) {
|
||
_f = true;
|
||
break;
|
||
}
|
||
}
|
||
if (!_f) {
|
||
res.push(card);
|
||
}
|
||
} else if (card.getProperty(prop) !== val) {
|
||
res.push(card);
|
||
}
|
||
});
|
||
arr = _.intersection(arr, res);
|
||
}
|
||
|
||
return arr;
|
||
};
|
||
|
||
return Battleside;
|
||
})();
|
||
|
||
module.exports = Battleside;
|
||
|
||
},{"../assets/data/deck":3,"./Card":15,"./Deck":16,"./Field":17,"./Hand":18,"underscore":12}],15:[function(require,module,exports){
|
||
"use strict";
|
||
|
||
var CardData = require("../assets/data/cards");
|
||
var AbilityData = require("../assets/data/abilities");
|
||
|
||
var Card = (function () {
|
||
var Card = function Card(key) {
|
||
if (!(this instanceof Card)) {
|
||
return new Card(key);
|
||
}
|
||
/**
|
||
* constructor here
|
||
*/
|
||
this._uidEvents = {};
|
||
this.setDisabled(false);
|
||
this._key = key;
|
||
this._data = CardData[key];
|
||
this._data.key = key;
|
||
this._boost = {};
|
||
this._forcedPower = -1;
|
||
this._init();
|
||
};
|
||
var r = Card.prototype;
|
||
/**
|
||
* methods && properties here
|
||
* r.property = null;
|
||
* r.getProperty = function() {...}
|
||
*/
|
||
r._key = null;
|
||
r._data = null;
|
||
r._id = null;
|
||
r._owner = null;
|
||
r._boost = null;
|
||
r._forcedPower = null;
|
||
r._disabled = null;
|
||
r._changedType = null;
|
||
Card.__id = 0;
|
||
Card.TYPE = {
|
||
CLOSE_COMBAT: 0,
|
||
RANGED: 1,
|
||
SIEGE: 2,
|
||
LEADER: 3,
|
||
SPECIAL: 4,
|
||
WEATHER: 5
|
||
};
|
||
|
||
r._uidEvents = null;
|
||
|
||
r.getUidEvents = function (key) {
|
||
return this._uidEvents[key];
|
||
};
|
||
|
||
r._init = function () {
|
||
this._id = ++Card.__id;
|
||
};
|
||
|
||
r.getName = function () {
|
||
return this._data.name;
|
||
};
|
||
r.getPower = function () {
|
||
if (this._data.power === -1) return 0;
|
||
if (this._forcedPower > -1) {
|
||
return (this._forcedPower > this._data.power ? this._data.power : this._forcedPower) + this.getBoost();
|
||
}
|
||
return this._data.power + this.getBoost();
|
||
};
|
||
r.getRawPower = function () {
|
||
return this._data.power;
|
||
};
|
||
/*r.calculateBoost = function(){
|
||
this._boost = 0;
|
||
for(var key in this._boosts) {
|
||
var boost = this._boosts[key];
|
||
this.boost(boost.getPower());
|
||
}
|
||
}*/
|
||
r.setForcedPower = function (nr) {
|
||
this._forcedPower = nr;
|
||
};
|
||
r.getRawAbility = function () {
|
||
return this._data.ability;
|
||
};
|
||
r.getAbility = function () {
|
||
if (Array.isArray(this._data.ability)) {
|
||
var res = [];
|
||
this._data.ability.forEach(function (ability) {
|
||
res.push(AbilityData[ability]);
|
||
});
|
||
return res;
|
||
}
|
||
return AbilityData[this._data.ability];
|
||
};
|
||
r.getImage = function () {
|
||
return "../assets/cards/" + this._data.img + ".png";
|
||
};
|
||
r.getFaction = function () {
|
||
return this._data.faction;
|
||
};
|
||
r.getMusterType = function () {
|
||
return this._data.musterType || null;
|
||
};
|
||
r.getType = function () {
|
||
return this._changedType == null ? this._data.type : this._changedType;
|
||
};
|
||
r.changeType = function (type) {
|
||
this._changedType = type;
|
||
};
|
||
r.getKey = function () {
|
||
return this._key;
|
||
};
|
||
|
||
r.getID = function () {
|
||
return this._id;
|
||
};
|
||
|
||
/*r.boost = function(nr){
|
||
this.getPower(); //to recalculate this._power;
|
||
this._boost += nr;
|
||
}*/
|
||
|
||
r.getBoost = function () {
|
||
var res = 0;
|
||
for (var key in this._boost) {
|
||
res += this._boost[key];
|
||
}
|
||
this.boost = res;
|
||
return res;
|
||
};
|
||
|
||
r.setBoost = function (key, val) {
|
||
this._boost[key] = val;
|
||
this.getBoost(); //to recalculate this.boost
|
||
};
|
||
|
||
r.isDisabled = function () {
|
||
return this._disabled;
|
||
};
|
||
|
||
r.setDisabled = function (b) {
|
||
this._disabled = b;
|
||
};
|
||
|
||
r.getProperty = function (prop) {
|
||
if (!this._data[prop]) return {};
|
||
return this._data[prop];
|
||
};
|
||
|
||
r.reset = function () {
|
||
this._changedType = null;
|
||
this._boost = {};
|
||
this.boost = 0;
|
||
};
|
||
|
||
return Card;
|
||
})();
|
||
|
||
module.exports = Card;
|
||
|
||
},{"../assets/data/abilities":1,"../assets/data/cards":2}],16:[function(require,module,exports){
|
||
"use strict";
|
||
|
||
var Card = require("./Card");
|
||
/*var CardManager = require("./CardManager");*/
|
||
|
||
var Deck = (function () {
|
||
var Deck = function Deck(deck) {
|
||
if (!(this instanceof Deck)) {
|
||
return new Deck(deck);
|
||
}
|
||
/**
|
||
* constructor here
|
||
*/
|
||
this._deck = [];
|
||
|
||
this._originalDeck = [];
|
||
this.setDeck(deck);
|
||
};
|
||
var r = Deck.prototype;
|
||
/**
|
||
* methods && properties here
|
||
* r.property = null;
|
||
* r.getProperty = function() {...}
|
||
*/
|
||
r._deck = null;
|
||
r._owner = null;
|
||
r._originalDeck = null;
|
||
|
||
r.setDeck = function (deckData) {
|
||
this._originalDeck = deckData.slice();
|
||
this._deck = deckData.slice();
|
||
|
||
this._loadCards();
|
||
this.shuffle();
|
||
};
|
||
|
||
r.getLength = function () {
|
||
return this._deck.length;
|
||
};
|
||
|
||
r.length = function () {
|
||
return this.getLength();
|
||
};
|
||
|
||
r.getDeck = function () {
|
||
return this._deck;
|
||
};
|
||
|
||
r.draw = function () {
|
||
if (!this._deck.length) return 0;
|
||
var card = this.pop();
|
||
return card;
|
||
};
|
||
|
||
r._loadCards = function () {
|
||
this._deck = this.getDeck().map(function (cardkey) {
|
||
return Card(cardkey);
|
||
});
|
||
};
|
||
|
||
r.pop = function () {
|
||
var id = this._deck.pop();
|
||
/*
|
||
var card = CardManager().getCardById(id);*/
|
||
return id;
|
||
};
|
||
|
||
r.find = function (key, val) {
|
||
var res = [];
|
||
this.getDeck().forEach(function (card) {
|
||
if (card.getProperty(key) == val) {
|
||
res.push(card);
|
||
}
|
||
});
|
||
return res;
|
||
};
|
||
|
||
r.removeFromDeck = function (card) {
|
||
var n = this.length();
|
||
|
||
for (var i = 0; i < n; i++) {
|
||
var c = this.getDeck()[i];
|
||
if (c.getID() === card.getID()) {
|
||
return this.getDeck().splice(i, 1)[0];
|
||
}
|
||
}
|
||
return -1;
|
||
};
|
||
|
||
r.shuffle = function () {
|
||
var deck = this.getDeck();
|
||
|
||
var n = this.length();
|
||
for (var i = n - 1; i > 0; i--) {
|
||
var j = Math.random() * i | 0;
|
||
var tmp;
|
||
|
||
tmp = deck[j];
|
||
deck[j] = deck[i];
|
||
deck[i] = tmp;
|
||
}
|
||
};
|
||
|
||
return Deck;
|
||
})();
|
||
|
||
module.exports = Deck;
|
||
|
||
},{"./Card":15}],17:[function(require,module,exports){
|
||
"use strict";
|
||
|
||
var Field = (function () {
|
||
var Field = function Field() {
|
||
if (!(this instanceof Field)) {
|
||
return new Field();
|
||
}
|
||
/**
|
||
* constructor here
|
||
*/
|
||
|
||
this._cards = [];
|
||
};
|
||
var r = Field.prototype;
|
||
/**
|
||
* methods && properties here
|
||
* r.property = null;
|
||
* r.getProperty = function() {...}
|
||
*/
|
||
|
||
r._cards = null;
|
||
r._score = 0;
|
||
|
||
r.add = function (card) {
|
||
this._cards.push(card);
|
||
this.updateScore();
|
||
};
|
||
|
||
r.get = function () {
|
||
return this._cards;
|
||
};
|
||
|
||
r.getScore = function () {
|
||
this.updateScore();
|
||
return this._score;
|
||
};
|
||
|
||
r.updateScore = function () {
|
||
this._score = 0;
|
||
for (var i = 0; i < this._cards.length; i++) {
|
||
var card = this._cards[i];
|
||
this._score += card.getPower();
|
||
}
|
||
};
|
||
|
||
r.getPosition = function (card) {
|
||
for (var i = 0; i < this._cards.length; i++) {
|
||
if (this._cards[i].getID() === card.getID()) return i;
|
||
}
|
||
return -1;
|
||
};
|
||
|
||
r.isOnField = function (card) {
|
||
return this.getPosition(card) >= 0;
|
||
};
|
||
|
||
r.replaceWith = function (oldCard, newCard) {
|
||
var index = this.getPosition(oldCard);
|
||
this._cards[index] = newCard;
|
||
oldCard.reset();
|
||
return oldCard;
|
||
};
|
||
|
||
r.getCard = function (id) {
|
||
for (var i = 0; i < this._cards.length; i++) {
|
||
var card = this._cards[i];
|
||
if (card.getID() == id) return card;
|
||
}
|
||
return -1;
|
||
};
|
||
|
||
r.removeAll = function () {
|
||
var tmp = this._cards.slice();
|
||
tmp.forEach(function (card) {
|
||
card.reset();
|
||
});
|
||
this._cards = [];
|
||
return tmp;
|
||
};
|
||
|
||
return Field;
|
||
})();
|
||
|
||
module.exports = Field;
|
||
|
||
},{}],18:[function(require,module,exports){
|
||
/*var $ = require("jquery");*/ /*
|
||
var CardManager = require("./CardManager");*/ /*
|
||
var PubSub = require("./pubsub");*/
|
||
"use strict";
|
||
|
||
var Card = require("./Card");
|
||
|
||
var Hand = (function () {
|
||
var Hand = function Hand() {
|
||
if (!(this instanceof Hand)) {
|
||
return new Hand();
|
||
}
|
||
/**
|
||
* constructor here
|
||
*/
|
||
|
||
this._hand = [];
|
||
};
|
||
var r = Hand.prototype;
|
||
/**
|
||
* methods && properties here
|
||
* r.property = null;
|
||
* r.getProperty = function() {...}
|
||
*/
|
||
r._hand = null;
|
||
|
||
r.add = function (card) {
|
||
this._hand.push(card);
|
||
};
|
||
|
||
r.getCards = function () {
|
||
return this._hand;
|
||
};
|
||
|
||
r.getCard = function (id) {
|
||
for (var i = 0; i < this.length(); i++) {
|
||
var card = this.getCards()[i];
|
||
if (card.getID() === id) return card;
|
||
}
|
||
return -1;
|
||
};
|
||
|
||
r.remove = function (id) {
|
||
var n = this.length();
|
||
|
||
//console.trace(id);
|
||
id = id instanceof Card ? id.getID() : id;
|
||
|
||
for (var i = 0; i < n; i++) {
|
||
if (this._hand[i].getID() != id) continue;
|
||
return this._hand.splice(i, 1);
|
||
}
|
||
|
||
return -1;
|
||
};
|
||
|
||
r.getRandomCard = function () {
|
||
var rnd = Math.random() * this._hand.length | 0;
|
||
return this._hand[rnd];
|
||
};
|
||
|
||
r.getLength = function () {
|
||
return this._hand.length;
|
||
};
|
||
|
||
r.length = function () {
|
||
return this._hand.length;
|
||
};
|
||
|
||
r.find = function (key, val) {
|
||
var res = [];
|
||
this._hand.forEach(function (card) {
|
||
if (card.getProperty(key) == val) {
|
||
res.push(card);
|
||
}
|
||
});
|
||
return res;
|
||
};
|
||
|
||
return Hand;
|
||
})();
|
||
|
||
module.exports = Hand;
|
||
|
||
},{"./Card":15}],19:[function(require,module,exports){
|
||
"use strict";
|
||
|
||
var Battle = require("../../server/Battle");
|
||
var Card = require("../../server/Card");
|
||
var data = require("../../assets/data/abilities");
|
||
|
||
describe("pubsub", function () {
|
||
var battle, card1, card2;
|
||
|
||
beforeEach(function () {
|
||
battle = {};
|
||
battle.runEvent = Battle.prototype.runEvent;
|
||
battle.on = Battle.prototype.on;
|
||
battle.off = Battle.prototype.off;
|
||
battle.events = {};
|
||
battle.update = function () {};
|
||
|
||
card1 = Card("kaedweni_siege_expert");
|
||
card2 = Card("dun_banner_medic");
|
||
});
|
||
|
||
it("on: has correct arguments", function () {
|
||
//this.on("EachTurn", ability.onEachTurn, this, [card])
|
||
|
||
battle.on("EachTurn", function (card) {
|
||
expect(card).toEqual(card1);
|
||
}, this, [card1]);
|
||
battle.runEvent("EachTurn");
|
||
});
|
||
it("runEvent: has correct arguments", function () {
|
||
//this.on("EachTurn", ability.onEachTurn, this, [card])
|
||
battle.on("EachTurn", function (c) {
|
||
expect(c).toEqual(card1);
|
||
});
|
||
battle.runEvent("EachTurn", null, [card1]);
|
||
});
|
||
it("on + runEvent: has correct arguments", function () {
|
||
//this.on("EachTurn", ability.onEachTurn, this, [card])
|
||
battle.on("EachTurn", function (c1, c2) {
|
||
expect(c1).toEqual(card1);
|
||
expect(c2).toEqual(card2);
|
||
}, null, [card1]);
|
||
battle.runEvent("EachTurn", null, [card2]);
|
||
});
|
||
it("test context", function () {
|
||
|
||
battle.on("EachTurn", function (card) {
|
||
expect(card.id).toEqual(card1.id);
|
||
expect(this.id).toEqual(card2.id);
|
||
}, card2, [card1]);
|
||
battle.runEvent("EachTurn");
|
||
});
|
||
it("test context", function () {
|
||
|
||
battle.on("EachTurn", function (card) {
|
||
expect(card.id).toEqual(card1.id);
|
||
expect(this.id).toEqual(card2.id);
|
||
}, null, [card1]);
|
||
battle.runEvent("EachTurn", card2);
|
||
});
|
||
it("test context", function () {
|
||
|
||
battle.on("EachTurn", function (card) {
|
||
expect(card.id).toEqual(card1.id);
|
||
expect(this.id).toEqual(card1.id);
|
||
}, card1, [card1]);
|
||
battle.runEvent("EachTurn", card2);
|
||
});
|
||
|
||
it("should handle off correctly", function () {
|
||
var cb1 = function cb1() {},
|
||
cb2 = function cb2() {};
|
||
var obj = {
|
||
cb1: cb1,
|
||
cb2: cb2
|
||
};
|
||
|
||
spyOn(obj, "cb1");
|
||
spyOn(obj, "cb2");
|
||
|
||
var uid1 = battle.on("EachCardPlace", obj.cb1, battle, [card1]);
|
||
var uid2 = battle.on("EachCardPlace", obj.cb2, battle, [card2]);
|
||
|
||
battle.off("EachCardPlace", uid2);
|
||
battle.runEvent("EachCardPlace");
|
||
|
||
expect(obj.cb1).toHaveBeenCalled();
|
||
expect(obj.cb2).not.toHaveBeenCalled();
|
||
|
||
/*battle.off("EachCardPlace", uid1);
|
||
expect(battle.events).toEqual({});*/
|
||
});
|
||
});
|
||
|
||
},{"../../assets/data/abilities":1,"../../server/Battle":13,"../../server/Card":15}],20:[function(require,module,exports){
|
||
"use strict";
|
||
|
||
var Card = require("../../server/Card");
|
||
var Battleside = require("../../server/Battleside");
|
||
var data = require("../../assets/data/abilities");
|
||
|
||
describe("filter", function () {
|
||
var card, side, filter, cards;
|
||
beforeEach(function () {
|
||
filter = Battleside.prototype.filter;
|
||
cards = [];
|
||
cards.push(Card("iorveth"));
|
||
cards.push(Card("toruviel"));
|
||
cards.push(Card("isengrim_faoiltiarnah"));
|
||
cards.push(Card("decoy"));
|
||
});
|
||
|
||
it("it should filter heroes out", function () {
|
||
var res = filter(cards, {
|
||
"ability": "hero"
|
||
});
|
||
expect(res.length).toBe(2);
|
||
});
|
||
|
||
it("it should filter hero and special cards out", function () {
|
||
var res = filter(cards, {
|
||
"ability": "hero",
|
||
"type": Card.TYPE.SPECIAL
|
||
});
|
||
expect(res.length).toBe(1);
|
||
});
|
||
});
|
||
|
||
},{"../../assets/data/abilities":1,"../../server/Battleside":14,"../../server/Card":15}],21:[function(require,module,exports){
|
||
"use strict";
|
||
|
||
require("./filterSpec");
|
||
require("./PubSubSpec");
|
||
|
||
(function main() {})();
|
||
|
||
},{"./PubSubSpec":19,"./filterSpec":20}]},{},[21])(21)
|
||
});
|
||
//# sourceMappingURL=data:application/json;charset:utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyaWZ5L25vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCJZOi9odGRvY3MvdGltLzIwMTUvZ3dlbnQvYXNzZXRzL2RhdGEvYWJpbGl0aWVzLmpzIiwiWTovaHRkb2NzL3RpbS8yMDE1L2d3ZW50L2Fzc2V0cy9kYXRhL2NhcmRzLmpzIiwiWTovaHRkb2NzL3RpbS8yMDE1L2d3ZW50L2Fzc2V0cy9kYXRhL2RlY2suanMiLCJub2RlX21vZHVsZXMvc2hvcnRpZC9saWIvYWxwaGFiZXQuanMiLCJub2RlX21vZHVsZXMvc2hvcnRpZC9saWIvZGVjb2RlLmpzIiwibm9kZV9tb2R1bGVzL3Nob3J0aWQvbGliL2VuY29kZS5qcyIsIm5vZGVfbW9kdWxlcy9zaG9ydGlkL2xpYi9pbmRleC5qcyIsIm5vZGVfbW9kdWxlcy9zaG9ydGlkL2xpYi9pcy12YWxpZC5qcyIsIm5vZGVfbW9kdWxlcy9zaG9ydGlkL2xpYi9yYW5kb20vcmFuZG9tLWJ5dGUtYnJvd3Nlci5qcyIsIm5vZGVfbW9kdWxlcy9zaG9ydGlkL2xpYi9yYW5kb20vcmFuZG9tLWZyb20tc2VlZC5qcyIsIm5vZGVfbW9kdWxlcy9zaG9ydGlkL2xpYi91dGlsL2NsdXN0ZXItd29ya2VyLWlkLWJyb3dzZXIuanMiLCJub2RlX21vZHVsZXMvdW5kZXJzY29yZS91bmRlcnNjb3JlLmpzIiwiWTovaHRkb2NzL3RpbS8yMDE1L2d3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ICAgICAgdmFyIF9mID0gZmFsc2U7XHJcbiAgICAgICAgICBmb3IodmFyIGkgPSAwOyBpIDwgcHJvcGVydHkubGVuZ3RoOyBpKyspIHtcclxuICAgICAgICAgICAgaWYocHJvcGVydHlbaV0gPT09IHZhbCkge1xyXG4gICAgICAgICAgICAgIF9mID0gdHJ1ZTtcclxuICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgfVxyXG4gICAgICAgICAgaWYoIV9mKXtcclxuICAgICAgICAgICAgcmVzLnB1c2goY2FyZCk7XHJcbiAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGVsc2UgaWYoY2FyZC5nZXRQcm9wZXJ0eShwcm9wKSAhPT0gdmFsKXtcclxuICAgICAgICAgIHJlcy5wdXNoKGNhcmQpO1xyXG4gICAgICAgIH1cclxuICAgICAgfSlcclxuICAgICAgYXJyID0gXy5pbnRlcnNlY3Rpb24oYXJyLCByZXMpO1xyXG4gICAgfVxyXG5cclxuICAgIHJldHVybiBhcnI7XHJcbiAgfVxyXG5cclxuICByZXR1cm4gQmF0dGxlc2lkZTtcclxufSkoKTtcclxuXHJcbm1vZHVsZS5leHBvcnRzID0gQmF0dGxlc2lkZTsiLCJ2YXIgQ2FyZERhdGEgPSByZXF1aXJlKFwiLi4vYXNzZXRzL2RhdGEvY2FyZHNcIik7XHJcbnZhciBBYmlsaXR5RGF0YSA9IHJlcXVpcmUoXCIuLi9hc3NldHMvZGF0YS9hYmlsaXRpZXNcIik7XHJcblxyXG52YXIgQ2FyZCA9IChmdW5jdGlvbigpe1xyXG4gIHZhciBDYXJkID0gZnVuY3Rpb24oa2V5KXtcclxuICAgIGlmKCEodGhpcyBpbnN0YW5jZW9mIENhcmQpKXtcclxuICAgICAgcmV0dXJuIChuZXcgQ2FyZChrZXkpKTtcclxuICAgIH1cclxuICAgIC8qKlxyXG4gICAgICogY29uc3RydWN0b3IgaGVyZVxyXG4gICAgICovXHJcbiAgIC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