-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#6: Added type field to all model types, started styling resolve list…
… components
- Loading branch information
1 parent
7ab97de
commit e5d05c8
Showing
15 changed files
with
218 additions
and
7 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
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import * as React from 'react'; | ||
import { Text, Small } from 'rebass'; | ||
|
||
import InfoPane from 'game/components/InfoPane'; | ||
|
||
import { Colour, ColourStrings } from 'models/values'; | ||
import { ID } from 'models/utils'; | ||
import Combat from 'models/combat'; | ||
|
||
type CombatListItemProps = { | ||
combat: Combat; | ||
} | ||
|
||
const CombatListItem: React.StatelessComponent<CombatListItemProps> = ({ combat }) => { | ||
return ( | ||
<InfoPane> | ||
<Text>Combat <Small>{combat.location.data.type == "territory" ? "Territory" : "Edge"} {combat.location.data.id} </Small></Text> | ||
</InfoPane > | ||
); | ||
} | ||
|
||
export default CombatListItem; |
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import * as React from 'react'; | ||
import { Text, Small } from 'rebass'; | ||
|
||
import InfoPane from 'game/components/InfoPane'; | ||
|
||
import { Colour, ColourStrings } from 'models/values'; | ||
import { ID } from 'models/utils'; | ||
import Player from 'models/player'; | ||
|
||
type PlayerListItemProps = { | ||
player: Player; | ||
} | ||
|
||
const PlayerListItem: React.StatelessComponent<PlayerListItemProps> = ({ player }) => { | ||
const colour = ColourStrings[player.data.colour]; | ||
|
||
return ( | ||
<InfoPane> | ||
<Text color={colour}>Player {player.data.id}</Text> | ||
</InfoPane> | ||
); | ||
} | ||
|
||
export default PlayerListItem; |
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import * as React from 'react'; | ||
import { Text, Small } from 'rebass'; | ||
|
||
import InfoPane from 'game/components/InfoPane'; | ||
|
||
import { Colour, ColourStrings } from 'models/values'; | ||
import { ID } from 'models/utils'; | ||
import Territory from 'models/territory'; | ||
|
||
type TerritoryListItemProps = { | ||
territory: Territory; | ||
} | ||
|
||
const TerritoryListItem: React.StatelessComponent<TerritoryListItemProps> = ({ territory }) => { | ||
const colour = ColourStrings[territory.player ? territory.player.data.colour : Colour.BLACK]; | ||
|
||
return ( | ||
<InfoPane> | ||
<Text color={colour}>Territory {territory.data.id}</Text> | ||
</InfoPane> | ||
); | ||
} | ||
|
||
export default TerritoryListItem; |
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import * as React from 'react'; | ||
import { Text, Small } from 'rebass'; | ||
|
||
import InfoPane from 'game/components/InfoPane'; | ||
|
||
import { Colour, ColourStrings } from 'models/values'; | ||
import { ID } from 'models/utils'; | ||
import Unit from 'models/unit'; | ||
|
||
type UnitListItemProps = { | ||
unit: Unit; | ||
} | ||
|
||
const UnitListItem: React.StatelessComponent<UnitListItemProps> = ({ unit }) => { | ||
const colour = ColourStrings[unit.player ? unit.player.data.colour : Colour.BLACK]; | ||
|
||
return ( | ||
<InfoPane> | ||
<Text color={colour}>Unit {unit.data.id} <Small color={ColourStrings[Colour.BLACK]}>{unit.location.data.type == "territory" ? "Territory" : "Edge"} {unit.data.locationId}</Small></Text> | ||
</InfoPane> | ||
); | ||
} | ||
|
||
export default UnitListItem; |
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
Oops, something went wrong.