-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Hero: Frozen, Immune Minion: Enraged, Immune, Silenced, Untargetable, Buffed Progress on #7.
- Loading branch information
Showing
16 changed files
with
106 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,39 @@ | ||
import * as React from "react"; | ||
import EntityInPlay from "./EntityInPlay"; | ||
import * as _ from "lodash"; | ||
import EntityList from "./EntityList"; | ||
import Entity from "../../Entity"; | ||
import Option from "../../Option"; | ||
import Minion from "./Minion"; | ||
import {EntityListProps} from "../../interfaces"; | ||
|
||
import {EntityInPlayProps, EntityListProps} from "../../interfaces"; | ||
interface FieldProps extends EntityListProps { | ||
buffedEntities?: number[]; | ||
} | ||
|
||
export default class Field extends EntityList<EntityListProps> { | ||
export default class Field extends EntityList<FieldProps> { | ||
|
||
protected className(): string { | ||
return 'field'; | ||
} | ||
|
||
protected renderEntity(entity: Entity, option: Option) { | ||
return (<Minion entity={entity} | ||
option={option} | ||
optionCallback={this.props.optionCallback} | ||
assetDirectory={this.props.assetDirectory} | ||
cardArtDirectory={this.props.cardArtDirectory} | ||
cards={this.props.cards} | ||
controller={this.props.controller} | ||
descriptors={this.props.descriptors} | ||
/>); | ||
option={option} | ||
optionCallback={this.props.optionCallback} | ||
assetDirectory={this.props.assetDirectory} | ||
cardArtDirectory={this.props.cardArtDirectory} | ||
cards={this.props.cards} | ||
controller={this.props.controller} | ||
descriptors={this.props.descriptors} | ||
buffed={entity && this.props.buffedEntities && this.props.buffedEntities.indexOf(entity.id) !== -1} | ||
/>); | ||
} | ||
|
||
|
||
public shouldComponentUpdate(nextProps: FieldProps, nextState): boolean { | ||
if (!_.isEqual(nextProps.buffedEntities, this.props.buffedEntities)) { | ||
return true; | ||
} | ||
return super.shouldComponentUpdate(nextProps, nextState); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters