Пример #1
0
        void MinusItem(string nm)
        {
            myItem obj = GetItem(nm);

            if ((obj != null) && (obj.InBag == true))
            {
                obj.InBag = false;
                mf.Itemlist.Items.Remove(obj.name);
            }
        }
Пример #2
0
        public void userItemClick(string nm)
        {
            myItem obj = GetItem(nm);

            if (obj == null)
            {
                return;
            }
            ExecCommand(obj.Onclick);
        }
Пример #3
0
        void PlusItem(string nm)
        {
            myItem obj = GetItem(nm);

            if (obj != null)
            {
                obj.InBag = true;
                mf.Itemlist.Items.Add(obj.name);
            }
        }
Пример #4
0
        void processing(string curword)
        {
            if ((waitact) || (waitblc))
            {
                if (waitact)
                {
                    cmb = new myAction(mf);
                }
                else
                {
                    cmb = new CmBlock(mf);
                }
                cmb.name = curline;

                do
                {
                    str++;
                    if ((tf[str] != "/act") && (tf[str] != "/block") && (tf[str] != "/b"))
                    {
                        cmb.AddCommand(tf[str]);
                    }
                }while((tf[str] != "/act") && (tf[str] != "/block") && (tf[str] != "/b"));
                str--;
                if (waitact)
                {
                    waitact = false;
                }
                else
                {
                    waitblc = false;
                }
            }
            if (waitloc)
            {
                loca      = new Location(mf);
                loca.name = curword;
                do
                {
                    str++;
                    if (tf[str] != "/descr")
                    {
                        loca.discr += tf[str] + '\n';
                    }
                }while(tf[str] != "/descr");
                waitloc = false;
            }
            if (curword == "*loc")
            {
                roomcount++;
                waitloc = true;
            }
            if (curword == "/loc")
            {
                waitloc = false;
                waitact = false;
                waitblc = false;
                waitaut = false;
                mf.theCore.AddRoom(loca);
                if (roomcount == 1)
                {
                    mf.FirstRoom = loca.name;
                }
                loca = null;
            }
            if (curword == "*act")
            {
                waitact = true;
            }
            if (curword == "/act")
            {
                waitact = false;
                (cmb as IAction).visible = true;
                loca.AddCmBlock(cmb);
                cmb = null;
            }
            if ((curword == "/block") || (curword == "/b"))
            {
                waitblc = false;
                if (loca != null)
                {
                    loca.AddCmBlock(cmb);
                }
                else
                {
                    mf.theCore.getGlobPtr().AddCmBlock(cmb);
                }

                cmb = null;
            }
            if (waitaut)
            {
                loca.Auto = curword;
                waitaut   = false;
            }
            if (waititm)
            {
                itm.name = curline;                        //.Remove((curline.Length-1),1);
                waititm  = false;
            }
            if (waitclk)
            {
                itm.Onclick = curline;
                waitclk     = false;
            }
            if ((curword == "*block") || (curword == "*b"))
            {
                waitblc = true;
            }
            if (curword == "*auto")
            {
                waitaut = true;
            }
            if (curword == "*item")
            {
                itm     = new myItem();
                waititm = true;
            }
            if (curword == "*onclick")
            {
                waitclk = true;
            }
            if (curword == "/item")
            {
                waitclk = false;
                waititm = false;
                mf.theCore.AddItem(itm);

                itm = null;
            }
        }
Пример #5
0
 public void AddItem(myItem itm)
 {
     vd.itms.Add(itm);
 }