forked from janpadrta/dune
-
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.
- Loading branch information
padrta
committed
Sep 23, 2016
1 parent
25cda65
commit 0d8ac72
Showing
44 changed files
with
995 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Place all the behaviors and hooks related to the matching controller here. | ||
# All this logic will automatically be available in application.js. | ||
# You can use CoffeeScript in this file: http://coffeescript.org/ |
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,3 @@ | ||
// Place all the styles related to the Buildings controller here. | ||
// They will automatically be included in application.css. | ||
// You can use Sass (SCSS) here: http://sass-lang.com/ |
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,74 @@ | ||
class BuildingsController < ApplicationController | ||
before_action :set_building, only: [:show, :edit, :update, :destroy] | ||
|
||
# GET /buildings | ||
# GET /buildings.json | ||
def index | ||
@buildings = Building.all | ||
end | ||
|
||
# GET /buildings/1 | ||
# GET /buildings/1.json | ||
def show | ||
end | ||
|
||
# GET /buildings/new | ||
def new | ||
@building = Building.new | ||
end | ||
|
||
# GET /buildings/1/edit | ||
def edit | ||
end | ||
|
||
# POST /buildings | ||
# POST /buildings.json | ||
def create | ||
@building = Building.new(building_params) | ||
|
||
respond_to do |format| | ||
if @building.save | ||
format.html { redirect_to @building, notice: 'Building was successfully created.' } | ||
format.json { render :show, status: :created, location: @building } | ||
else | ||
format.html { render :new } | ||
format.json { render json: @building.errors, status: :unprocessable_entity } | ||
end | ||
end | ||
end | ||
|
||
# PATCH/PUT /buildings/1 | ||
# PATCH/PUT /buildings/1.json | ||
def update | ||
respond_to do |format| | ||
if @building.update(building_params) | ||
format.html { redirect_to @building, notice: 'Building was successfully updated.' } | ||
format.json { render :show, status: :ok, location: @building } | ||
else | ||
format.html { render :edit } | ||
format.json { render json: @building.errors, status: :unprocessable_entity } | ||
end | ||
end | ||
end | ||
|
||
# DELETE /buildings/1 | ||
# DELETE /buildings/1.json | ||
def destroy | ||
@building.destroy | ||
respond_to do |format| | ||
format.html { redirect_to buildings_url, notice: 'Building was successfully destroyed.' } | ||
format.json { head :no_content } | ||
end | ||
end | ||
|
||
private | ||
# Use callbacks to share common setup or constraints between actions. | ||
def set_building | ||
@building = Building.find(params[:id]) | ||
end | ||
|
||
# Never trust parameters from the scary internet, only allow the white list through. | ||
def building_params | ||
params.require(:building).permit(:type, :name, :description, :population_bonus, :melange_bonus, :material_bonus, :solar_bonus, :exp_bonus, :population_cost, :melange_cost, :material_cost, :solar_cost, :exp_cost) | ||
end | ||
end |
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,2 @@ | ||
module BuildingsHelper | ||
end |
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,26 @@ | ||
# == Schema Information | ||
# | ||
# Table name: buildings | ||
# | ||
# id :integer not null, primary key | ||
# type :string | ||
# name :string not null | ||
# description :string default("") | ||
# population_bonus :decimal(12, 4) default(0.0) | ||
# melange_bonus :decimal(12, 4) default(0.0) | ||
# material_bonus :decimal(12, 4) default(0.0) | ||
# solar_bonus :decimal(12, 4) default(0.0) | ||
# exp_bonus :decimal(12, 4) default(0.0) | ||
# population_cost :decimal(12, 4) default(0.0) | ||
# melange_cost :decimal(12, 4) default(0.0) | ||
# material_cost :decimal(12, 4) default(0.0) | ||
# solar_cost :decimal(12, 4) default(0.0) | ||
# exp_cost :decimal(12, 4) default(0.0) | ||
# created_at :datetime not null | ||
# updated_at :datetime not null | ||
# | ||
|
||
class Building < ApplicationRecord | ||
has_many :estates | ||
has_many :fields, through: :estates | ||
end |
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 @@ | ||
# == Schema Information | ||
# | ||
# Table name: buildings | ||
# | ||
# id :integer not null, primary key | ||
# type :string | ||
# name :string not null | ||
# description :string default("") | ||
# population_bonus :decimal(12, 4) default(0.0) | ||
# melange_bonus :decimal(12, 4) default(0.0) | ||
# material_bonus :decimal(12, 4) default(0.0) | ||
# solar_bonus :decimal(12, 4) default(0.0) | ||
# exp_bonus :decimal(12, 4) default(0.0) | ||
# population_cost :decimal(12, 4) default(0.0) | ||
# melange_cost :decimal(12, 4) default(0.0) | ||
# material_cost :decimal(12, 4) default(0.0) | ||
# solar_cost :decimal(12, 4) default(0.0) | ||
# exp_cost :decimal(12, 4) default(0.0) | ||
# created_at :datetime not null | ||
# updated_at :datetime not null | ||
# | ||
|
||
class Building::Material < Building | ||
end |
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 @@ | ||
# == Schema Information | ||
# | ||
# Table name: buildings | ||
# | ||
# id :integer not null, primary key | ||
# type :string | ||
# name :string not null | ||
# description :string default("") | ||
# population_bonus :decimal(12, 4) default(0.0) | ||
# melange_bonus :decimal(12, 4) default(0.0) | ||
# material_bonus :decimal(12, 4) default(0.0) | ||
# solar_bonus :decimal(12, 4) default(0.0) | ||
# exp_bonus :decimal(12, 4) default(0.0) | ||
# population_cost :decimal(12, 4) default(0.0) | ||
# melange_cost :decimal(12, 4) default(0.0) | ||
# material_cost :decimal(12, 4) default(0.0) | ||
# solar_cost :decimal(12, 4) default(0.0) | ||
# exp_cost :decimal(12, 4) default(0.0) | ||
# created_at :datetime not null | ||
# updated_at :datetime not null | ||
# | ||
|
||
class Building::Material::Borehole < Building::Material | ||
end |
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 @@ | ||
# == Schema Information | ||
# | ||
# Table name: buildings | ||
# | ||
# id :integer not null, primary key | ||
# type :string | ||
# name :string not null | ||
# description :string default("") | ||
# population_bonus :decimal(12, 4) default(0.0) | ||
# melange_bonus :decimal(12, 4) default(0.0) | ||
# material_bonus :decimal(12, 4) default(0.0) | ||
# solar_bonus :decimal(12, 4) default(0.0) | ||
# exp_bonus :decimal(12, 4) default(0.0) | ||
# population_cost :decimal(12, 4) default(0.0) | ||
# melange_cost :decimal(12, 4) default(0.0) | ||
# material_cost :decimal(12, 4) default(0.0) | ||
# solar_cost :decimal(12, 4) default(0.0) | ||
# exp_cost :decimal(12, 4) default(0.0) | ||
# created_at :datetime not null | ||
# updated_at :datetime not null | ||
# | ||
|
||
class Building::Material::DeepCore < Building::Material | ||
end |
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 @@ | ||
# == Schema Information | ||
# | ||
# Table name: buildings | ||
# | ||
# id :integer not null, primary key | ||
# type :string | ||
# name :string not null | ||
# description :string default("") | ||
# population_bonus :decimal(12, 4) default(0.0) | ||
# melange_bonus :decimal(12, 4) default(0.0) | ||
# material_bonus :decimal(12, 4) default(0.0) | ||
# solar_bonus :decimal(12, 4) default(0.0) | ||
# exp_bonus :decimal(12, 4) default(0.0) | ||
# population_cost :decimal(12, 4) default(0.0) | ||
# melange_cost :decimal(12, 4) default(0.0) | ||
# material_cost :decimal(12, 4) default(0.0) | ||
# solar_cost :decimal(12, 4) default(0.0) | ||
# exp_cost :decimal(12, 4) default(0.0) | ||
# created_at :datetime not null | ||
# updated_at :datetime not null | ||
# | ||
|
||
class Building::Material::Mine < Building::Material | ||
end |
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,25 @@ | ||
# == Schema Information | ||
# | ||
# Table name: buildings | ||
# | ||
# id :integer not null, primary key | ||
# type :string | ||
# name :string not null | ||
# description :string default("") | ||
# population_bonus :decimal(12, 4) default(0.0) | ||
# melange_bonus :decimal(12, 4) default(0.0) | ||
# material_bonus :decimal(12, 4) default(0.0) | ||
# solar_bonus :decimal(12, 4) default(0.0) | ||
# exp_bonus :decimal(12, 4) default(0.0) | ||
# population_cost :decimal(12, 4) default(0.0) | ||
# melange_cost :decimal(12, 4) default(0.0) | ||
# material_cost :decimal(12, 4) default(0.0) | ||
# solar_cost :decimal(12, 4) default(0.0) | ||
# exp_cost :decimal(12, 4) default(0.0) | ||
# created_at :datetime not null | ||
# updated_at :datetime not null | ||
# | ||
|
||
class Building::Melange < Building | ||
|
||
end |
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 @@ | ||
# == Schema Information | ||
# | ||
# Table name: buildings | ||
# | ||
# id :integer not null, primary key | ||
# type :string | ||
# name :string not null | ||
# description :string default("") | ||
# population_bonus :decimal(12, 4) default(0.0) | ||
# melange_bonus :decimal(12, 4) default(0.0) | ||
# material_bonus :decimal(12, 4) default(0.0) | ||
# solar_bonus :decimal(12, 4) default(0.0) | ||
# exp_bonus :decimal(12, 4) default(0.0) | ||
# population_cost :decimal(12, 4) default(0.0) | ||
# melange_cost :decimal(12, 4) default(0.0) | ||
# material_cost :decimal(12, 4) default(0.0) | ||
# solar_cost :decimal(12, 4) default(0.0) | ||
# exp_cost :decimal(12, 4) default(0.0) | ||
# created_at :datetime not null | ||
# updated_at :datetime not null | ||
# | ||
|
||
class Building::Melange::Arraken < Building::Melange | ||
end |
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 @@ | ||
# == Schema Information | ||
# | ||
# Table name: buildings | ||
# | ||
# id :integer not null, primary key | ||
# type :string | ||
# name :string not null | ||
# description :string default("") | ||
# population_bonus :decimal(12, 4) default(0.0) | ||
# melange_bonus :decimal(12, 4) default(0.0) | ||
# material_bonus :decimal(12, 4) default(0.0) | ||
# solar_bonus :decimal(12, 4) default(0.0) | ||
# exp_bonus :decimal(12, 4) default(0.0) | ||
# population_cost :decimal(12, 4) default(0.0) | ||
# melange_cost :decimal(12, 4) default(0.0) | ||
# material_cost :decimal(12, 4) default(0.0) | ||
# solar_cost :decimal(12, 4) default(0.0) | ||
# exp_cost :decimal(12, 4) default(0.0) | ||
# created_at :datetime not null | ||
# updated_at :datetime not null | ||
# | ||
|
||
class Building::Melange::Harvester < Building::Melange | ||
end |
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 @@ | ||
# == Schema Information | ||
# | ||
# Table name: buildings | ||
# | ||
# id :integer not null, primary key | ||
# type :string | ||
# name :string not null | ||
# description :string default("") | ||
# population_bonus :decimal(12, 4) default(0.0) | ||
# melange_bonus :decimal(12, 4) default(0.0) | ||
# material_bonus :decimal(12, 4) default(0.0) | ||
# solar_bonus :decimal(12, 4) default(0.0) | ||
# exp_bonus :decimal(12, 4) default(0.0) | ||
# population_cost :decimal(12, 4) default(0.0) | ||
# melange_cost :decimal(12, 4) default(0.0) | ||
# material_cost :decimal(12, 4) default(0.0) | ||
# solar_cost :decimal(12, 4) default(0.0) | ||
# exp_cost :decimal(12, 4) default(0.0) | ||
# created_at :datetime not null | ||
# updated_at :datetime not null | ||
# | ||
|
||
class Building::Population < Building | ||
end |
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 @@ | ||
# == Schema Information | ||
# | ||
# Table name: buildings | ||
# | ||
# id :integer not null, primary key | ||
# type :string | ||
# name :string not null | ||
# description :string default("") | ||
# population_bonus :decimal(12, 4) default(0.0) | ||
# melange_bonus :decimal(12, 4) default(0.0) | ||
# material_bonus :decimal(12, 4) default(0.0) | ||
# solar_bonus :decimal(12, 4) default(0.0) | ||
# exp_bonus :decimal(12, 4) default(0.0) | ||
# population_cost :decimal(12, 4) default(0.0) | ||
# melange_cost :decimal(12, 4) default(0.0) | ||
# material_cost :decimal(12, 4) default(0.0) | ||
# solar_cost :decimal(12, 4) default(0.0) | ||
# exp_cost :decimal(12, 4) default(0.0) | ||
# created_at :datetime not null | ||
# updated_at :datetime not null | ||
# | ||
|
||
class Building::Population::City < Building::Population | ||
end |
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 @@ | ||
# == Schema Information | ||
# | ||
# Table name: buildings | ||
# | ||
# id :integer not null, primary key | ||
# type :string | ||
# name :string not null | ||
# description :string default("") | ||
# population_bonus :decimal(12, 4) default(0.0) | ||
# melange_bonus :decimal(12, 4) default(0.0) | ||
# material_bonus :decimal(12, 4) default(0.0) | ||
# solar_bonus :decimal(12, 4) default(0.0) | ||
# exp_bonus :decimal(12, 4) default(0.0) | ||
# population_cost :decimal(12, 4) default(0.0) | ||
# melange_cost :decimal(12, 4) default(0.0) | ||
# material_cost :decimal(12, 4) default(0.0) | ||
# solar_cost :decimal(12, 4) default(0.0) | ||
# exp_cost :decimal(12, 4) default(0.0) | ||
# created_at :datetime not null | ||
# updated_at :datetime not null | ||
# | ||
|
||
class Building::Population::Metropolis < Building::Population | ||
end |
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 @@ | ||
# == Schema Information | ||
# | ||
# Table name: buildings | ||
# | ||
# id :integer not null, primary key | ||
# type :string | ||
# name :string not null | ||
# description :string default("") | ||
# population_bonus :decimal(12, 4) default(0.0) | ||
# melange_bonus :decimal(12, 4) default(0.0) | ||
# material_bonus :decimal(12, 4) default(0.0) | ||
# solar_bonus :decimal(12, 4) default(0.0) | ||
# exp_bonus :decimal(12, 4) default(0.0) | ||
# population_cost :decimal(12, 4) default(0.0) | ||
# melange_cost :decimal(12, 4) default(0.0) | ||
# material_cost :decimal(12, 4) default(0.0) | ||
# solar_cost :decimal(12, 4) default(0.0) | ||
# exp_cost :decimal(12, 4) default(0.0) | ||
# created_at :datetime not null | ||
# updated_at :datetime not null | ||
# | ||
|
||
class Building::Population::Town < Building::Population | ||
end |
Oops, something went wrong.