Skip to content
Snippets Groups Projects
Commit 217a7672 authored by FLU CHARLY's avatar FLU CHARLY
Browse files

Merge branch 'main' into 'main'

Ajout commentaire game

See merge request !165
parents 755c6eb3 29124bcf
1 merge request!165Ajout commentaire game
......@@ -12,7 +12,6 @@ namespace game
public class Seed : BasicPlant
{
private int timeGrowth;
/// <summary>
/// Ce constructeur est juste là pour la compilation.
/// </summary>
......@@ -51,7 +50,7 @@ namespace game
CreateAllSeedPlant.dicoPlant.createSeed(seed);
}*/
/// <summary>
/// La méthode <c>getTimeGrowth</c> permet de connaître le temps de pousse de la graine.
/// </summary>
......
......@@ -8,56 +8,23 @@ namespace game
{
/// <summary>
/// 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>
public class Shop : MonoBehaviour
{
public Inventory inventory;
// 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>();
/// <summary>
/// Ce constructeur est l pour la compilation
/// Ce constructeur est là pour la compilation
/// </summary>
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.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace game
......@@ -13,14 +11,20 @@ namespace game
InventoryPlant inventory;
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)
{
market = Xmarket;
inventory = Xinventory;
game = Xgame;
}
//item_sell
//item_sell
struct Item
{
public EnumTypePlant item_sale { get; set; }
......@@ -30,7 +34,13 @@ namespace game
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)
{
Item item = new Item();
......@@ -41,7 +51,11 @@ namespace game
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()
{
int price = 0;
......@@ -61,7 +75,11 @@ namespace game
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)
{
game.money += price;
......
......@@ -51,8 +51,6 @@ namespace game
this.imageLink = Resources.Load<Sprite>("Sprites/" + spriteLink);
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