Commit b178c167 authored by Matthew Odle's avatar Matthew Odle

villager display details reduced; only show number of villagers in bad states

parent 0640877d
......@@ -5,8 +5,8 @@ import { Building } from './building';
export class Buildings extends React.Component {
render(props) {
return <div>
<div className="buildings clearfix">
return <div className="buildingContainer">
<div className="buildings">
<h3>Buildings</h3>
{ this.props.buildings.map( building =>
<Building
......@@ -18,6 +18,7 @@ export class Buildings extends React.Component {
/>
)}
</div>
<div className="clear"></div>
</div>;
}
}
import React from 'react';
import { StatusRow } from './status-row';
export class Status extends React.Component {
render(props) {
const statuses = this.props.statuses;
return <div className="statusContainer">
<h3>Status</h3>
<div className="statuses">
<div className="infos">
{ Array.from(Object.keys(statuses)).map( status =>
<StatusRow key={status} status={status} count={statuses[status]}/>
)}
</div>
</div>
</div>;
}
}
import React from 'react';
import { StoreRow } from './store-row';
export class Stores extends React.Component {
render(props) {
const stores = this.props.stores.slice();
return <div className="storeContainer">
<h3>Stores</h3>
<div className="stores">
<div className="resources">
{ stores.map( item =>
<StoreRow key={item.name} item={item} />
)}
</div>
</div>
</div>;
}
}
import React from 'react';
import { StoreRow } from './store-row';
import { StatusRow } from './status-row';
import { Stores } from './stores';
import { Status } from './status';
import { Buildings } from './buildings';
export class VillageManagement extends React.Component {
......@@ -88,32 +88,16 @@ export class VillageManagement extends React.Component {
render = () => {
const statuses = this.props.villagerStatus;
const stores = this.props.villageStore.slice();
return <div className="management">
<Buildings buildings={this.props.buildings}
manageVillagerAssignments={this.manageVillagerAssignments}
increasePriority={this.increasePriority}
decreasePriority={this.decreasePriority}
/>
<div className="storeContainer">
<h3>Stores</h3>
<div className="stores">
<div className="resources">
{ this.props.villageStore.map( item =>
<StoreRow key={item.name} item={item} />
)}
</div>
</div>
</div>
<div className="statusContainer">
<h3>Status</h3>
<div className="statuses">
<div className="infos">
{ Array.from(Object.keys(statuses)).map( status =>
<StatusRow key={status} status={status} count={statuses[status]}/>
)}
</div>
</div>
</div>
<Stores stores={stores} />
<Status statuses={statuses} />
<div className="clear"></div>
</div>
}
}
......@@ -10,6 +10,10 @@ export class Village extends React.Component {
buildings.sort((a, b) => a.priority > b.priority)
}
sortStores = (stores) => {
stores.sort((a, b) => a.name > b.name)
}
constructor(props) {
super();
this.state = {
......@@ -376,6 +380,7 @@ export class Village extends React.Component {
render = () => {
const villageStore = this.props.villageStore.slice();
this.sortStores(villageStore);
const buildings = this.props.buildings.slice();
this.sortBuildings(buildings);
const villagers = this.props.villagers.slice();
......
......@@ -39,12 +39,12 @@ button {
overflow: hidden;
}
.buildings {
.buildingContainer {
float: left;
margin-right: 1em;
}
.building {
width: auto;
width: 150px;
min-height: 3.5em;
padding: 2px;
margin: 2px 0;
......@@ -96,11 +96,12 @@ button {
.storeContainer {
right: 0px;
top: 0px;
position: absolute;
float: right;
}
.statusContainer {
right: 0px;
right: 250px;
top: 0px;
float: right;
}
.stores, .statuses {
position: relative;
......@@ -108,7 +109,7 @@ button {
border: 1px solid black;
cursor: default;
padding: 5px 10px;
width: 200px;
width: 140px;
}
.resources, .infos {
display: block;
......@@ -168,4 +169,17 @@ button {
width: 700px;
height: 700px;
}
.building {
width: auto;
}
.storeContainer {
position: absolute;
right: 250px;
top: 0px;
}
.statusContainer {
position: absolute;
right: 0px;
top: 0px;
}
}
......@@ -19,7 +19,7 @@ const knobsAndLevers = {
villagerHasTool: true,
toolMultiplier: 4,
toolDurability: 100,
toolDegradeRate: 15,
toolDegradeRate: 1,
villagerClothed: true,
clothingDegradeRate: 1,
......@@ -28,7 +28,7 @@ const knobsAndLevers = {
warmthReplenishThreshold: 10,
warmthPerFirewood: 80,
baseEnergyDegradeRate: 10,
baseEnergyDegradeRate: 1,
assignmentEnergyMultiplier: 2,
energyReplenishThreshold: 10,
energyPerFood: 80,
......@@ -37,10 +37,10 @@ const knobsAndLevers = {
defaultCapacity: 50,
defaultProductionRate: 1,
defaultToolStores: 0,
defaultFirewoodStores: 0,
defaultFoodStores: 5,
defaultClothingStores: 0,
defaultToolStores: 25,
defaultFirewoodStores: 25,
defaultFoodStores: 50,
defaultClothingStores: 25,
defaultHideStores: 0,
defaultIronStores: 0,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment