Skip to content
Snippets Groups Projects
Commit 475bdbbe authored by MARQUE ELISE's avatar MARQUE ELISE
Browse files

Merge branch 'main' of git.unistra.fr:le-groupe1/t3_2022

parents 6e2b4a19 217a7672
1 merge request!166Main
...@@ -12,7 +12,6 @@ namespace game ...@@ -12,7 +12,6 @@ namespace game
public class Seed : BasicPlant public class Seed : BasicPlant
{ {
private int timeGrowth; private int timeGrowth;
/// <summary> /// <summary>
/// Ce constructeur est juste là pour la compilation. /// Ce constructeur est juste là pour la compilation.
/// </summary> /// </summary>
...@@ -51,7 +50,7 @@ namespace game ...@@ -51,7 +50,7 @@ namespace game
CreateAllSeedPlant.dicoPlant.createSeed(seed); CreateAllSeedPlant.dicoPlant.createSeed(seed);
}*/ }*/
/// <summary> /// <summary>
/// La méthode <c>getTimeGrowth</c> permet de connaître le temps de pousse de la graine. /// La méthode <c>getTimeGrowth</c> permet de connaître le temps de pousse de la graine.
/// </summary> /// </summary>
......
...@@ -8,56 +8,23 @@ namespace game ...@@ -8,56 +8,23 @@ namespace game
{ {
/// <summary> /// <summary>
/// La classe <c>Shop</c> permet de cr�er un magasin avec toutes les graines qu'on peut acheter. /// La classe <c>Shop</c> permet de cr�er un magasin avec toutes les graines qu'on peut acheter.
/// Elle possde un attribut inventory et un dictionnaire qui contient tous les item du magasin. /// Elle possède un attribut inventory et un dictionnaire qui contient tous les item du magasin.
/// </summary> /// </summary>
public class Shop : MonoBehaviour public class Shop : MonoBehaviour
{ {
public Inventory inventory; public Inventory inventory;
// Magasin de vente de graines // Magasin de vente de graines
// C'est un inventaire haute quantit qui ne peut pas tre rduit // C'est un inventaire à haute quantité qui ne peut pas être réduit
public Dictionary<BasicItem, int> slots = new Dictionary<BasicItem, int>(); public Dictionary<BasicItem, int> slots = new Dictionary<BasicItem, int>();
/// <summary> /// <summary>
/// Ce constructeur est l pour la compilation /// Ce constructeur est là pour la compilation
/// </summary> /// </summary>
public Shop() public Shop()
{ {
/*
this.slots.Add(CreateAllSeedPlant.dicoPlant.createSeed(EnumTypePlant.ELB), 999);
this.slots.Add(CreateAllSeedPlant.dicoPlant.createSeed(EnumTypePlant.EGRO), 999);
this.slots.Add(CreateAllSeedPlant.dicoPlant.createSeed(EnumTypePlant.AJOS), 999);
this.slots.Add(CreateAllSeedPlant.dicoPlant.createSeed(EnumTypePlant.AZLOC), 999);/*
this.slots.Add(CreateAllSeedPlant.dicoPlant.createSeed(EnumTypePlant.ECHAV), 999);
this.slots.Add(CreateAllSeedPlant.dicoPlant.createSeed(EnumTypePlant.ONTOUM), 999);
this.slots.Add(CreateAllSeedPlant.dicoPlant.createSeed(EnumTypePlant.ELUOP), 999);
this.slots.Add(CreateAllSeedPlant.dicoPlant.createSeed(EnumTypePlant.NIPAL), 999);*/
} }
/// <summary>
/// La m�thode <c>Start</c> est utilis�e pour le d�marrage. �tant donn� que Start n'est appel�e qu'une seule fois, elle permet d'initialiser les �l�ments
/// qui doivent persister tout au long de la vie du script, mais ne doivent �tre configur�s qu'imm�diatement avant utilisation.
/// Pour notre cas elle initialise le magasin.
/// </summary>
void Start()
{
//Debug.Log("Shop pr�sent au clique");
/* this.slots.Add(CreateAllSeedPlant.dicoPlant.createSeed(EnumTypePlant.ELB), 999);
this.slots.Add(CreateAllSeedPlant.dicoPlant.createSeed(EnumTypePlant.EGRO), 999);
this.slots.Add(CreateAllSeedPlant.dicoPlant.createSeed(EnumTypePlant.AJOS), 999);
this.slots.Add(CreateAllSeedPlant.dicoPlant.createSeed(EnumTypePlant.AZLOC), 999); */
//inventory.afficheInventory(slots);
}
/*
public void getAllPrice()
{
foreach (KeyValuePair<string, int> st in stock)
{
Console.WriteLine("BasicItem: {0}, prix: {1}", st.Key, st.Value);
}
}*/
} }
......
using System; using System;
using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using UnityEngine;
namespace game namespace game
...@@ -13,14 +11,20 @@ namespace game ...@@ -13,14 +11,20 @@ namespace game
InventoryPlant inventory; InventoryPlant inventory;
Game game; Game game;
/// <summary>
/// La mthode <c>Stand</c> instancie un nouveau Stand
/// </summary>
/// <param name="Xmarket">The market.</param>
/// <param name="Xinventory">The inventory.</param>
/// <param name="Xgame">The game.</param>
public Stand(Market Xmarket, InventoryPlant Xinventory, Game Xgame) public Stand(Market Xmarket, InventoryPlant Xinventory, Game Xgame)
{ {
market = Xmarket; market = Xmarket;
inventory = Xinventory; inventory = Xinventory;
game = Xgame; game = Xgame;
} }
//item_sell //item_sell
struct Item struct Item
{ {
public EnumTypePlant item_sale { get; set; } public EnumTypePlant item_sale { get; set; }
...@@ -30,7 +34,13 @@ namespace game ...@@ -30,7 +34,13 @@ namespace game
private List<Item> listeItem = new List<Item>(); private List<Item> listeItem = new List<Item>();
//store items for sale //store items for sale
/// <summary>
/// La mthode <c>stock_sale</c> ajoute un item dans la listeItem.
/// </summary>
/// <param name="Xitem_sale">The xitem sale.</param>
/// <param name="Xitem_number">The xitem number.</param>
/// <param name="Xitem_price">The xitem price.</param>
public void stock_sale(EnumTypePlant Xitem_sale, int Xitem_number, int Xitem_price) public void stock_sale(EnumTypePlant Xitem_sale, int Xitem_number, int Xitem_price)
{ {
Item item = new Item(); Item item = new Item();
...@@ -41,7 +51,11 @@ namespace game ...@@ -41,7 +51,11 @@ namespace game
listeItem.Add(item); listeItem.Add(item);
} }
//function that when you call it goes around all the stuff on sale and sells it //function that when you call it goes around all the stuff on sale and sells it
/// <summary>
/// La mthode <c>sell_stock</c> vend l'item choisit.
/// </summary>
/// <returns>System.Int32.</returns>
public int sell_stock() public int sell_stock()
{ {
int price = 0; int price = 0;
...@@ -61,7 +75,11 @@ namespace game ...@@ -61,7 +75,11 @@ namespace game
return price; return price;
} }
//add price //add price
/// <summary>
/// La mthode <c>add_price</c> ajoute l'argent au joueur.
/// </summary>
/// <param name="price">The price.</param>
public void add_price(int price) public void add_price(int price)
{ {
game.money += price; game.money += price;
......
...@@ -51,8 +51,6 @@ namespace game ...@@ -51,8 +51,6 @@ namespace game
this.imageLink = Resources.Load<Sprite>("Sprites/" + spriteLink); this.imageLink = Resources.Load<Sprite>("Sprites/" + spriteLink);
this.price = paraPrice; this.price = paraPrice;
} }
} }
} }
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