search by min discipline

This commit is contained in:
Daniel
2017-11-24 17:57:07 -05:00
parent 5599001269
commit 4019d161b6
2 changed files with 27 additions and 7 deletions

File diff suppressed because one or more lines are too long

View File

@@ -94,6 +94,13 @@ export default class SearchForm extends React.Component {
<label>Max Energy: <input type="text" style={{width: '30px'}} ref={(input) => this.energy.max = input} /></label>
</div>
<br />
<div>
<label>Min <img height="16" className="icon" src={"/src/img/icons/disciplines/courage.png"} />: <input type="text" style={{width: '30px'}} ref={(input) => this.stones.courage = input} /></label>&nbsp;
<label>Min <img height="16" className="icon" src={"/src/img/icons/disciplines/power.png"} />: <input type="text" style={{width: '30px'}} ref={(input) => this.stones.power = input} /></label>&nbsp;
<label>Min <img height="16" className="icon" src={"/src/img/icons/disciplines/wisdom.png"} />: <input type="text" style={{width: '30px'}} ref={(input) => this.stones.wisdom = input} /></label>&nbsp;
<label>Min <img height="16" className="icon" src={"/src/img/icons/disciplines/speed.png"} />: <input type="text" style={{width: '30px'}} ref={(input) => this.stones.speed = input} /></label>
</div>
<br />
<div>
<label><input type="checkbox" ref={(input) => this.stones.unique = input}/>Unique</label>&nbsp;
<label><input type="checkbox" ref={(input) => this.stones.loyal = input}/>loyal</label>&nbsp;
@@ -264,6 +271,19 @@ export default class SearchForm extends React.Component {
creatureResults = creatureResults.find({'gsx$energy': {'$lte': this.energy.max.value}});
}
if (this.stones.courage.value > 0) {
creatureResults = creatureResults.find({'gsx$courage': {'$gte': this.stones.courage.value}});
}
if (this.stones.power.value > 0) {
creatureResults = creatureResults.find({'gsx$power': {'$gte': this.stones.power.value}});
}
if (this.stones.wisdom.value > 0) {
creatureResults = creatureResults.find({'gsx$wisdom': {'$gte': this.stones.wisdom.value}});
}
if (this.stones.speed.value > 0) {
creatureResults = creatureResults.find({'gsx$speed': {'$gte': this.stones.speed.value}});
}
if (this.stones.unique.checked) {
creatureResults = creatureResults.find({'gsx$unique': {'$gt': 0}});
attackResults = attackResults.find({'gsx$unique': {'$gt': 0}});