コード例 #1
0
        private bool addEditItem(int index)
        {
            if (curUnit == null || curUnit.Item == null || curUnit.Item.Img == null)
            {
                return(false);
            }

            curUnit.X = index;
            curUnit.Y = 0;
            editor.updateData(curUnit.Item);
            if (canPutItem(curUnit) && putItem(curUnit, true))
            {
                return(true);
            }
            else
            {
                MessageBox.Show("[" + curUnit.Item.Name + "]");
            }
            return(false);
        }
コード例 #2
0
        private bool addEditItem(int x, int y)
        {
            if (curUnit == null || curUnit.Item == null || curUnit.Item.Img == null)
            {
                return(false);
            }


            curUnit.X = x;
            curUnit.Y = y;
            editor.GenSerial();
            editor.updateData(curUnit.Item);
            if (canPutItem(curUnit) && putItem(curUnit, true))
            {
                return(true);
            }
            else
            {
                MessageBox.Show("There is not enough space to put this item·[" + curUnit.Item.Name + "]");
            }
            return(false);
        }