Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

test commit

  • Loading branch information...
commit cfe48f272c8ba2a708f170dba2259815f4927e7f 1 parent f06121d
@Doktoros Doktoros authored
Showing with 20 additions and 19 deletions.
  1. +1 −0  .gitignore
  2. +19 −19 app/models/prepocet.rb
View
1  .gitignore
@@ -5,3 +5,4 @@ tmp/
.sass-cache/
exporty/
config/database.yml
+.idea
View
38 app/models/prepocet.rb
@@ -1,23 +1,23 @@
# encoding: utf-8
class Prepocet
def self.kompletni_prepocet
- puts a = Time.now
+ puts a = Time.now
Prepocet.zamkni
order = Prepocet.vytvor_eody
Prepocet.zmen_vudce(order)
Prepocet.zpristupni_planety
Prepocet.produkce_suroviny(order)
Prepocet.odemkni
- puts b = Time.now
+ puts b = Time.now
end
def self.vytvor_eody
order = User.find(1).eods.where(:date => Date.today).maximum(:order)
- if order
- order += 1
- else
- order = 1
- end
+ if order
+ order += 1
+ else
+ order = 1
+ end
for user in User.all do
Eod.new(
:user_id => user.id,
@@ -27,7 +27,7 @@ def self.vytvor_eody
).save
end
puts "Eody vyvtoreny"
- return order
+ return order
end
def self.produkce_suroviny(order)
@@ -58,21 +58,21 @@ def self.produkce_suroviny(order)
:material_income => material,
:population_income => population
).save
- end
- puts "suroviny vyprodukovany"
+ end
+ puts "suroviny vyprodukovany "
end
def self.zpristupni_planety
- puts "Zpristupnuji planety"
+ puts "Zpristupnuji planety"
for planeta in Planet.objevene do
if planeta.discovered_at < Constant::PLANETA_DOSTUPNA_PO.days.ago.to_date
planeta.update_attribut(:available_for_all, true)
puts "Zpristupnena planeta #{planeta.name}/#{planeta.systema_name}"
end
- end
+ end
end
- def self.zmen_vudce(order)
+ def self.zmen_vudce(order)
houses = House.where('name NOT IN (?)', 'Renegáti').includes(:users, :votes)
for house in houses do
puts "Delam #{house.name}"
@@ -95,16 +95,16 @@ def self.zmen_vudce(order)
end
house.eod_zapis_vudce(order, new_vudce)
end
- puts "vudcove zmeneni"
+ puts "vudcove zmeneni"
end
- def self.odemkni
+ def self.odemkni
Aplikace.odemkni_hru
- puts "hra odemcena"
+ puts "hra odemcena"
end
- def self.zamkni
+ def self.zamkni
Aplikace.zamkni_hru
- puts "hra uzamcena"
+ puts "hra uzamcena"
end
-end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.