Skip to content

Commit

Permalink
feat: Reformat code
Browse files Browse the repository at this point in the history
  • Loading branch information
Vinetos committed May 27, 2020
1 parent 9d3bd62 commit 395f6b1
Show file tree
Hide file tree
Showing 64 changed files with 2,620 additions and 2,406 deletions.
16 changes: 9 additions & 7 deletions Game/Buildings/Building.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ private Building(BuildingType type, Vector2 position, int theLvl)
Activated = true;
Characteristics.Lvl = theLvl;
Characteristics.Lvl = theLvl;

PlanInitial.MAX_CAR += Characteristics.NbCar;
ListBuildings.Add(this);
}
Expand All @@ -29,7 +29,7 @@ private Building(BuildingType type, Vector2 position, int theLvl)
/// La position du building sur la map
/// </summary>
public Vector2 Position { get; }

/// <summary>
/// Si le batiment est activé
/// </summary>
Expand Down Expand Up @@ -75,17 +75,18 @@ public static Building Create(BuildingType type, Vector2 position, int theLvl =

public static void verify(BuildingType type)
{

}

public void energyAndWater(Building type)
{
(int energy, int water) = (Characteristics.energy[Characteristics.Lvl],Characteristics.water[Characteristics.Lvl]);
if (energy<0)
(int energy, int water) = (Characteristics.energy[Characteristics.Lvl],
Characteristics.water[Characteristics.Lvl]);
if (energy < 0)
{
Ref_donnees.energy -= energy;
Interface.Water -= water;
}
else if(water < 0)
else if (water < 0)
{
Ref_donnees.water -= water;
Interface.Energy -= energy;
Expand Down Expand Up @@ -148,7 +149,7 @@ private void Upgrade()
Interface.Xp += Characteristics.GainXp[Characteristics.Lvl];
Characteristics.Lvl += 1;
}

public static Building GetFromTile(Vector2 tile)
{
var i = 0;
Expand All @@ -160,6 +161,7 @@ public static Building GetFromTile(Vector2 tile)
return batiment;
i++;
}

return null;
}
}
Expand Down
2 changes: 1 addition & 1 deletion Game/Buildings/BuildingCharacteristics.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public interface IBuildingCharacteristics
int Lvl { get; set; }
int[] GainXp { get; }
int[] energy { get; }
int[] water { get; }
int[] water { get; }
string[] Image { get; }
int NbrAmeliorations { get; }
int NbCar { get; }
Expand Down
2 changes: 1 addition & 1 deletion Game/Buildings/Characteristics/Cafe.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public Cafe()
Image = new[] {"res://assets/ImageSized/isometric magasin6.png"};
NbrAmeliorations = 0;
NbCar = 0;
Population =new[] {0};
Population = new[] {0};
}

public int[] Bloc { get; }
Expand Down
5 changes: 3 additions & 2 deletions Game/Buildings/Characteristics/CentraleElectrique.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ public CentraleElectrique()
GainXp = new[] {10, 15};
energy = new[] {-30, -70};
water = new[] {3, 6};
Image = new[] {"res://assets/ImageSized/isometric centrale1.png", "res://assets/ImageSized/isometric centrale2.png"};
Image = new[]
{"res://assets/ImageSized/isometric centrale1.png", "res://assets/ImageSized/isometric centrale2.png"};
NbrAmeliorations = 1;
NbCar = 0;
Population = new [] {0, 0};
Population = new[] {0, 0};
}

public int[] Bloc { get; }
Expand Down
8 changes: 6 additions & 2 deletions Game/Buildings/Characteristics/Eglise.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,14 @@ public Eglise()
GainXp = new[] {10, 15, 30};
energy = new[] {2, 4, 6};
water = new[] {1, 3, 9};
Image = new[] {"res://assets/ImageSized/isometric eglise1.png", "res://assets/ImageSized/isometric eglise5.png", "res://assets/ImageSized/isometric eglise4.png"};
Image = new[]
{
"res://assets/ImageSized/isometric eglise1.png", "res://assets/ImageSized/isometric eglise5.png",
"res://assets/ImageSized/isometric eglise4.png"
};
NbrAmeliorations = 2;
NbCar = 0;
Population = new []{0, 0, 0};
Population = new[] {0, 0, 0};
}

public int[] Bloc { get; }
Expand Down
2 changes: 1 addition & 1 deletion Game/Buildings/Characteristics/Eolienne.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public Eolienne()
Image = new[] {"res://assets/ImageSized/isometric par eoliennes.png"};
NbrAmeliorations = 0;
NbCar = 0;
Population = new []{0};
Population = new[] {0};
}

public int[] Bloc { get; }
Expand Down
4 changes: 2 additions & 2 deletions Game/Buildings/Characteristics/Epuration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public Epuration()
{
Bloc = new[] {Ref_donnees.stationEpuration};
Cost = new[] {3000};
Earn = new[] {2,5,8};
Earn = new[] {2, 5, 8};
Titre = new[] {"Epuration"};
Lvl = 0;
GainXp = new[] {10, 100, 500};
Expand All @@ -17,7 +17,7 @@ public Epuration()
Image = new[] {"res://assets/ImageSized/station epuration2.png"};
NbrAmeliorations = 0;
NbCar = 3;
Population = new []{0};
Population = new[] {0};
}

public int[] Bloc { get; }
Expand Down
2 changes: 1 addition & 1 deletion Game/Buildings/Characteristics/Essence.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public Essence()
Image = new[] {"res://assets/ImageSized/isometric station service1.png"};
NbrAmeliorations = 0;
NbCar = 2;
Population = new []{0};
Population = new[] {0};
}

public int[] Bloc { get; }
Expand Down
7 changes: 4 additions & 3 deletions Game/Buildings/Characteristics/Ferme.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,17 @@ public Ferme()
{
Bloc = new[] {Ref_donnees.ferme, Ref_donnees.ferme_ecolo};
Cost = new[] {3000, 4000};
Earn = new[] {2,5};
Earn = new[] {2, 5};
Titre = new[] {"Ferme", "Ferme Ecolo"};
Lvl = 0;
GainXp = new[] {10, 15};
energy = new[] {1, 0};
water = new[] {3, 0};
Image = new[] {"res://assets/ImageSized/isometric ferme2.png", "res://assets/ImageSized/I ferme ecolobis.png"};
Image = new[]
{"res://assets/ImageSized/isometric ferme2.png", "res://assets/ImageSized/I ferme ecolobis.png"};
NbrAmeliorations = 1;
NbCar = 3;
Population = new []{0, 0};
Population = new[] {0, 0};
}

public int[] Bloc { get; }
Expand Down
5 changes: 3 additions & 2 deletions Game/Buildings/Characteristics/FermeGrande.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ public FermeGrande()
GainXp = new[] {10, 15};
energy = new[] {10, 20};
water = new[] {11, 22};
Image = new[] {"res://assets/ImageSized/isometric ferme3.png", "res://assets/ImageSized/isometric ferme4.png"};
Image = new[]
{"res://assets/ImageSized/isometric ferme3.png", "res://assets/ImageSized/isometric ferme4.png"};
NbrAmeliorations = 1;
NbCar = 2;
Population = new []{0, 0};
Population = new[] {0, 0};
}

public int[] Bloc { get; }
Expand Down
2 changes: 1 addition & 1 deletion Game/Buildings/Characteristics/FeteForraine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public FeteForraine()
Image = new[] {"res://assets/ImageSized/isometric fete foraine1.png"};
NbrAmeliorations = 0;
NbCar = 2;
Population = new []{0};
Population = new[] {0};
}

public int[] Bloc { get; }
Expand Down
11 changes: 8 additions & 3 deletions Game/Buildings/Characteristics/Foot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,21 @@ public Foot()
{
Bloc = new[] {Ref_donnees.foot, Ref_donnees.footlv2, Ref_donnees.footlv3};
Cost = new[] {3000, 10000, 20000};
Earn = new[] {2,50, 100};
Earn = new[] {2, 50, 100};
Titre = new[] {"Terrain Foot", "Stadium", "Stade"};
Lvl = 0;
GainXp = new[] {10, 15, 30};
energy = new[] {1, 5, 10};
water = new[] {1, 5, 10};
Image = new[] {"res://assets/ImageSized/isometric terrain foot1.png", "res://assets/ImageSized/isometric terrain foot2.png", "res://assets/ImageSized/isometric terrain foot3.png"};
Image = new[]
{
"res://assets/ImageSized/isometric terrain foot1.png",
"res://assets/ImageSized/isometric terrain foot2.png",
"res://assets/ImageSized/isometric terrain foot3.png"
};
NbrAmeliorations = 2;
NbCar = 1;
Population = new []{0, 0, 0};
Population = new[] {0, 0, 0};
}

public int[] Bloc { get; }
Expand Down
8 changes: 6 additions & 2 deletions Game/Buildings/Characteristics/Hospital.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,14 @@ public Hospital()
GainXp = new[] {10, 15, 30};
energy = new[] {2, 5, 10};
water = new[] {2, 5, 10};
Image = new[] {"res://assets/ImageSized/hopital.png", "res://assets/ImageSized/hopital3.png", "res://assets/ImageSized/hopital4.png"};
Image = new[]
{
"res://assets/ImageSized/hopital.png", "res://assets/ImageSized/hopital3.png",
"res://assets/ImageSized/hopital4.png"
};
NbrAmeliorations = 2;
NbCar = 5;
Population = new []{0, 0, 0};
Population = new[] {0, 0, 0};
}

public int[] Bloc { get; }
Expand Down
9 changes: 6 additions & 3 deletions Game/Buildings/Characteristics/Hotel.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using System;
using SshCity.Game.Plan;

namespace SshCity.Game.Buildings.Characteristics
Expand All @@ -9,13 +8,17 @@ public Hotel()
{
Bloc = new[] {Ref_donnees.hotel1, Ref_donnees.hotel, Ref_donnees.hotel2};
Cost = new[] {2000, 10000, 15000};
Earn = new[] {2,15,50};
Earn = new[] {2, 15, 50};
Titre = new[] {"Môtel", "Hotel", "Palace"};
Lvl = 0;
GainXp = new[] {10, 15, 30};
energy = new[] {2, 10, 25};
water = new[] {2, 10, 25};
Image = new[] {"res://assets/ImageSized/I hotel.png", "res://assets/ImageSized/hotel.png", "res://assets/ImageSized/isometric hotel1.png"};
Image = new[]
{
"res://assets/ImageSized/I hotel.png", "res://assets/ImageSized/hotel.png",
"res://assets/ImageSized/isometric hotel1.png"
};
NbrAmeliorations = 2;
NbCar = 3;
Population = new[] {5, 20, 30};
Expand Down
12 changes: 8 additions & 4 deletions Game/Buildings/Characteristics/Maison.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,17 @@ public Maison()
{
Bloc = new[] {Ref_donnees.maison1, Ref_donnees.immeuble_vert, Ref_donnees.immeubleVert};
Cost = new[] {1000, 3000, 10000};
Earn = new[] {1,2,5};
Earn = new[] {1, 2, 5};
Titre = new[] {"Maison", "Immeuble", "Tour"};
Lvl = 0;
GainXp = new[] {10, 15, 30};
energy = new[] {1,3,6};
water = new[] {1,3,3};
Image = new[] {"res://assets/ImageSized/maison1.png", "res://assets/ImageSized/immeuble.png", "res://assets/ImageSized/isometric hotel.png"};
energy = new[] {1, 3, 6};
water = new[] {1, 3, 3};
Image = new[]
{
"res://assets/ImageSized/maison1.png", "res://assets/ImageSized/immeuble.png",
"res://assets/ImageSized/isometric hotel.png"
};
NbrAmeliorations = 2;
NbCar = 2;
Population = new[] {5, 15, 30};
Expand Down
4 changes: 2 additions & 2 deletions Game/Buildings/Characteristics/Maison3.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ public Maison3()
Titre = new[] {"Maison", "Tour"};
Lvl = 0;
GainXp = new[] {10, 15};
energy = new[] {1,3};
water = new[] {1,3};
energy = new[] {1, 3};
water = new[] {1, 3};
Image = new[] {"res://assets/ImageSized/maison3.png", "res://assets/ImageSized/maison2.png"};
NbrAmeliorations = 1;
NbCar = 2;
Expand Down
4 changes: 2 additions & 2 deletions Game/Buildings/Characteristics/Maison4.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ public Maison4()
Titre = new[] {"Maison", "Tour"};
Lvl = 0;
GainXp = new[] {10, 15};
energy = new[] {1,3};
water = new[] {1,3};
energy = new[] {1, 3};
water = new[] {1, 3};
Image = new[] {"res://assets/ImageSized/maison4.png", "res://assets/ImageSized/isometric immeuble.png"};
NbrAmeliorations = 1;
NbCar = 2;
Expand Down
2 changes: 1 addition & 1 deletion Game/Buildings/Characteristics/Maison5.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public Maison5()
Titre = new[] {"Maison", "Maison Ecolo"};
Lvl = 0;
GainXp = new[] {10, 15};
energy = new[] {2,0};
energy = new[] {2, 0};
water = new[] {2, 0};
Image = new[] {"res://assets/ImageSized/maison5.png", "res://assets/ImageSized/isometric maison ecolo.png"};
NbrAmeliorations = 1;
Expand Down
8 changes: 6 additions & 2 deletions Game/Buildings/Characteristics/Mosque.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,14 @@ public Mosque()
GainXp = new[] {10, 15, 30};
energy = new[] {1, 3, 6};
water = new[] {2, 3, 5};
Image = new[] {"res://assets/ImageSized/isometric mosquee2.png", "res://assets/ImageSized/isometric mosquee1.png", "res://assets/ImageSized/isometric mosquee3.png"};
Image = new[]
{
"res://assets/ImageSized/isometric mosquee2.png", "res://assets/ImageSized/isometric mosquee1.png",
"res://assets/ImageSized/isometric mosquee3.png"
};
NbrAmeliorations = 2;
NbCar = 0;
Population =new[] {0, 0, 0};
Population = new[] {0, 0, 0};
}

public int[] Bloc { get; }
Expand Down
8 changes: 6 additions & 2 deletions Game/Buildings/Characteristics/Parc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,17 @@ public Parc()
{
Bloc = new[] {Ref_donnees.parc_enfant, Ref_donnees.parc2, Ref_donnees.parc3};
Cost = new[] {100, 1000, 5000};
Earn = new[] {1, 3,6};
Earn = new[] {1, 3, 6};
Titre = new[] {"Parc", "Parc", "Parc"};
Lvl = 0;
GainXp = new[] {10, 15, 30};
energy = new[] {0, 0, 0};
water = new[] {0, 0, 0};
Image = new[] {"res://assets/ImageSized/iso parc enfant4.png", "res://assets/ImageSized/I parc enfant.png", "res://assets/ImageSized/I parc enfant2.png"};
Image = new[]
{
"res://assets/ImageSized/iso parc enfant4.png", "res://assets/ImageSized/I parc enfant.png",
"res://assets/ImageSized/I parc enfant2.png"
};
NbrAmeliorations = 2;
NbCar = 0;
Population = new[] {0, 0, 0};
Expand Down
2 changes: 1 addition & 1 deletion Game/Buildings/Characteristics/Piscine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public Piscine()
{
Bloc = new[] {Ref_donnees.piscine};
Cost = new[] {10000};
Earn = new[] {20,30,50};
Earn = new[] {20, 30, 50};
Titre = new[] {"Piscine"};
Lvl = 0;
GainXp = new[] {10, 100, 500};
Expand Down
3 changes: 2 additions & 1 deletion Game/Buildings/Characteristics/Restaurant.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ public Restaurant()
GainXp = new[] {10, 15};
energy = new[] {1, 3};
water = new[] {2, 3};
Image = new[] {"res://assets/ImageSized/isometric boutique5.png", "res://assets/ImageSized/isometric boutique9.png"};
Image = new[]
{"res://assets/ImageSized/isometric boutique5.png", "res://assets/ImageSized/isometric boutique9.png"};
NbrAmeliorations = 1;
NbCar = 0;
Population = new[] {0, 0};
Expand Down
2 changes: 1 addition & 1 deletion Game/Buildings/Characteristics/Solaire.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public Solaire()
Image = new[] {"res://assets/ImageSized/isometric parc panneaux solaires.png"};
NbrAmeliorations = 0;
NbCar = 0;
Population =new[] {0};
Population = new[] {0};
}

public int[] Bloc { get; }
Expand Down
10 changes: 7 additions & 3 deletions Game/Buildings/Characteristics/Usine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,13 @@ public Usine()
Titre = new[] {"Usine", "Usine", "Usine", "Usine"};
Lvl = 0;
GainXp = new[] {10, 15, 30, 60};
energy = new[] {5,10, 20, 30};
water = new[] {2,4, 9, 15};
Image = new[] {"res://assets/ImageSized/isometric usine1.png", "res://assets/ImageSized/isometric usine2.png", "res://assets/ImageSized/isometric usine3.png", "res://assets/ImageSized/isometric usine4.png"};
energy = new[] {5, 10, 20, 30};
water = new[] {2, 4, 9, 15};
Image = new[]
{
"res://assets/ImageSized/isometric usine1.png", "res://assets/ImageSized/isometric usine2.png",
"res://assets/ImageSized/isometric usine3.png", "res://assets/ImageSized/isometric usine4.png"
};
NbrAmeliorations = 3;
NbCar = 2;
Population = new[] {0, 0, 0, 0};
Expand Down
Loading

0 comments on commit 395f6b1

Please sign in to comment.