Ejemplo n.º 1
0
        public Tradelist AddList()
        {
            Tradelist mlist = new Tradelist();

            list.Add(mlist);
            return(mlist);
        }
Ejemplo n.º 2
0
        public static TradelistContainer FromFile(string filename)
        {
            TradelistContainer _container  = new TradelistContainer();
            Tradelist          currentlist = null;

            if (File.Exists(filename))
            {
                using (TraderReader reader = TraderReader.Open(filename))
                    while (reader.Read())
                    {
                        _container.TradeMenu = reader.Menu;
                        switch (reader[reader.Trade].node)
                        {
                        case TraderReader.NodeTypeSpeciafier.Grouped:
                            goto AddGroupList;

                        case TraderReader.NodeTypeSpeciafier.Single:
                            goto AddSinglelist;
                        }
                        return(null);

AddGroupList:
                        GroupedTradelist gtrade = GetSafeGroup(_container, reader.Trade);
                        currentlist             = GetSafeList(gtrade, reader.Group - 1);
                        goto AddItemCount;
AddSinglelist:
                        SingleTradelist strade = GetSafeSingle(_container, reader.Trade);
                        currentlist            = strade.list;
                        goto AddItemCount;
AddItemCount:
                        switch (reader.Type)
                        {
                        case TraderReader.NodeType.Production:
                            currentlist.AddProduct(reader.ItemId, reader.ItemCount);
                            break;

                        case TraderReader.NodeType.Supplement:
                            currentlist.AddSupplement(reader.ItemId, reader.ItemCount);
                            break;
                        }
                    }
            }

            return(_container);
        }
Ejemplo n.º 3
0
 public Tradelist AddList()
 {
     Tradelist mlist = new Tradelist();
     list.Add(mlist);
     return mlist;
 }