Exemplo n.º 1
0
    public override bool addElement(int type, string barrierId)
    {
        bool elementAdded = false;

        if (type == Controller.BARRIER)
        {
            Barrier newBarrier = new Barrier(barrierId, 200, 200, 100, 100);
            id++;
            BarrierDataControl newBarrierDataControl = new BarrierDataControl(sceneDataControl, newBarrier);
            barriersList.Add(newBarrier);
            barriersDataControlList.Add(newBarrierDataControl);
            elementAdded = true;
        }

        return(elementAdded);
    }
Exemplo n.º 2
0
    public override bool moveElementDown(DataControl dataControl)
    {
        bool elementMoved = false;
        int  elementIndex = barriersList.IndexOf((Barrier)dataControl.getContent());

        if (elementIndex < barriersList.Count - 1)
        {
            Barrier            o = barriersList[elementIndex];
            BarrierDataControl c = barriersDataControlList[elementIndex];
            barriersList.RemoveAt(elementIndex);
            barriersDataControlList.RemoveAt(elementIndex);
            barriersList.Insert(elementIndex + 1, o);
            barriersDataControlList.Insert(elementIndex + 1, c);
            //controller.dataModified( );
            elementMoved = true;
        }

        return(elementMoved);
    }