DragonSoul
30-03-2008, 11:23
using System;
using System.Collections.Generic;
using System.Text;
namespace Nik_i_Nak_Epizoda_1
{
class InventoryClass
{
public List<string> Inventory = new List<string>();
public static void AddToInventory(string ItemToAdd)
{
Inventory.Add(ItemToAdd);
Console.WriteLine("{0} je dodan u Inventory", ItemToAdd);
}
}
}
Imam ovaj kod. Želim napraviti inventory. Inventory bi trebao biti lista, a metode InventoryClass klase bi trebale manipulirati tim inventoriem(listom). Ali meni ovaj kod ne radi. Što trebam napraviti?
using System.Collections.Generic;
using System.Text;
namespace Nik_i_Nak_Epizoda_1
{
class InventoryClass
{
public List<string> Inventory = new List<string>();
public static void AddToInventory(string ItemToAdd)
{
Inventory.Add(ItemToAdd);
Console.WriteLine("{0} je dodan u Inventory", ItemToAdd);
}
}
}
Imam ovaj kod. Želim napraviti inventory. Inventory bi trebao biti lista, a metode InventoryClass klase bi trebale manipulirati tim inventoriem(listom). Ali meni ovaj kod ne radi. Što trebam napraviti?