Skip to content

Commit

Permalink
Merge pull request #208 from ORNL-AMO/cyos-0.2.0
Browse files Browse the repository at this point in the history
Cyos 0.2.0 into Dev
  • Loading branch information
nbintertech authored Feb 20, 2024
2 parents 86c2df7 + 4f76a8b commit a837e1a
Show file tree
Hide file tree
Showing 30 changed files with 4,252 additions and 2,564 deletions.
13 changes: 3 additions & 10 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,16 @@ rules:
no-unused-vars: off
no-mixed-spaces-and-tabs: warn
jsx-quotes:
- error
- warn
- prefer-single
quotes:
- error
- single
'@typescript-eslint/no-empty-interface': warn
'@typescript-eslint/no-unused-vars': off
'@typescript-eslint/ban-ts-comment': warn
'@typescript-eslint/consistent-type-imports': error
'@typescript-eslint/no-inferrable-types': warn
'@typescript-eslint/ban-ts-comment': off
'@typescript-eslint/no-inferrable-types': off
'react/prop-types': warn
'@typescript-eslint/no-this-alias':
- off # temp
-
allowDestructuring: false
allowedNames:
- self
semi:
- warn
- always
89 changes: 89 additions & 0 deletions GAMEPLAY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# Gameplay Mechanics, rules, logic,

**!!!!** - symbol denotes functionality that may need fixed/enhanced, or has an issue on the board

## General

- The game is played in 1 or 2 year budget periods (intervals)
- Players may move backwards a single budget period to make changes.
- Players receive additional budget at each year start
- 1 year: $75,000
- 2 year: $150,000


----

## Project Types and Behavior
### All Types:
- May be implemented and un-implemented in the implementation year
- Implementation applies energy savings immediately. Savings remain for all subsequent game years, **Except savings from projects w/ Related Maintenance**.

### Normal (Non-Renewable):
- **!!!!** Projects implemented in previous years become Completed Projects (in Year Recap) after the implementation year.

### Normal (Non-Renewable) W/ Related Maintenance:
- energy savings apply for the year implemented, but don't last for subsequent years. Savings may come back with a related project (see below)
- **Example** Scope 2 - Small Carport Solar Installation reveals Carport Solar - Maintenance

### Renewable:
- Are auto-implemented in all years following implementation. Can be unimplemented at any time to remove energy savings and costs
- Project cost is deducted from the budget at the start of each year it is renewed
- Year Recap project recap cards will only be displayed in the implementation year, unless the project was financed.
- **Example** Scope 2 - Mid-sized Solar PPPA


### Maintenance Renewable:
- Becomes available when it's parent/dependant is implemented.
- **Example** Scope 2 - Small Carport Solar Installation reveals Carport Solar - Maintenance

---
## Financing
At game start, players select the year that financing options should appear (years 1-5), and which options should be available, including: Xaas, Loan, Green Bonds. Currently, only one financing option is available per project.

Players will be awarded Capital Funding rewards (one free project) for reaching savings milestones of 15% and 40% throughout the game. Each Capital Funding reward must be used in the following year. VPPA projects are ineligible.

- Financed project recap cards appear at Year Recap for each year until they are paid in full. They are then part of Completed Projects. Financed Renewables will continue to appear at year recap.
- Financed normal non-renewables can't be unimplemented after the implementation year
- Financed Projects un-implemented from the Scopes page will have their implement button disabled. Player must select financing option from the project info dialog.

---
## Year Recap

### Current Projects list
**!!!!** Shows implemented projects, renewables projects, and any financed projects currently being paid on

### Completed Projects (Below graphs)
Shows completed projects after their implementation year, as well non-renewable financed projects.

### Hidden and Rebates


## Other
When players move backward one year, their project implementation choices, savings, and budget reflect that year's state prior to Year Recap



---

## Notes for Development

## Important notes, caveats, architecture, improvement opportunities

#### Project Tracking

Implemented renewable projects (any funding type) are added to implementedRenewableProjects as an ImplementedProject object - they are NOT added to `implementedFinancedProjects` and `implementedProjectIds` like other normal projects.

All normal projects are now added to `implementedFinancedProjects` and `implementedProjectIds`. This should eventually be refactored to drop implementedProjectIds


Capital Funding pays projects in full and has it's own state object, but is also considered a financing type so that the feature can follow the app's pattern for project implementation.

#### Opportunities

Implemented projects are being added to a number of arrays to track state between years, including implementedProjectIds, implementedFinancedProjects, implementedRenewableProjects, and so on. This was done to stay within existing app patterns. We should refactor for a single source of truth where implemented project objects have knowledge of their own state.






2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"test": "react-scripts test",
"eject": "react-scripts eject",
"electron:serve": "concurrently -k \"cross-env BROWSER=none npm run start\" \"npm run electron:start\"",
"electron:build": "npm run build && electron-builder -c.extraMetadata.main=build/main.js",
"electron:build:installer": "npm run build && electron-builder -c.extraMetadata.main=build/main.js",
"electron:start": "wait-on tcp:3000 && electron ."
},
"build": {
Expand Down
11 changes: 5 additions & 6 deletions src/App.scss
Original file line number Diff line number Diff line change
Expand Up @@ -74,20 +74,19 @@ $blur-radius: 5px;
justify-content: center;
display: flex;
flex-wrap: wrap;
& > * {
padding: 8px;
}
padding-left: 0;

}

.year-recap-rebate-surprise {
.year-recap-positive-surprise {
background: linear-gradient(to right bottom, rgba(63, 163, 0, 1), rgb(80, 161, 0) 120%)!important;
// color: rgba(255, 255, 255, 0.9)!important;
& .emphasis {
color: white;
}
}

.year-recap-hidden-surprise {
.year-recap-negative-surprise {
background: linear-gradient(to right bottom, rgba(251, 67, 67, 98%), rgb(147, 39, 39) 120%)!important;
// color: rgba(255, 255, 255, 0.9)!important;
& .emphasis {
Expand All @@ -96,7 +95,7 @@ $blur-radius: 5px;
}


#alert-dialog-slide-description, #selectYearInterval, #allowCarryover, #allowEnergyCarryover {
#alert-dialog-slide-description, #selectGameYearInterval, #selectFinancingStartYear, #selectAllowBudgetCarryover, #selectEnergyCarryoverYears {
color: black;
}

Expand Down
Loading

0 comments on commit a837e1a

Please sign in to comment.