示例#1
0
    public void panelClick()
    {
        switch (CowAppScript.listMode)
        {
        case 0:
            break;

        case 1:
            CowAppScript.currentFocusLocation = panelTarget;
            CowAppScript.changeMenu(4);
            break;

        case 2:
            CowAppScript.listMode          = 1;
            CowAppScript.requestedLocation = panelTarget;

            /*
             * CowAppScript.currentLocationList.Add(panelTarget);
             * CowAppScript.targetMenu = CowAppScript.requestingMenu;
             */
            break;

        case 3:
            Farm.getLocations().Remove(panelTarget);
            CowAppScript.listMode = 1;
            CowAppScript.getCurrentMenu().refreshMenu();
            break;
        }
    }
示例#2
0
 public void addAnimalButton()
 {
     CowAppScript.requestingMenu    = 4;
     CowAppScript.listMode          = 2;
     CowAppScript.currentAnimalList = CowAppScript.currentFocusLocation.getAnimalsAtLocation();
     CowAppScript.changeMenu(1);
 }
示例#3
0
    public void panelClick()
    {
        switch (CowAppScript.listMode)
        {
        case 0:
            break;

        case 1:
            CowAppScript.currentFocusAnimal = panelTarget;
            CowAppScript.changeMenu(3);
            CowAppScript.getCurrentMenu().refreshMenu();
            break;

        case 2:
            CowAppScript.listMode        = 1;
            CowAppScript.requestedAnimal = panelTarget;

            /*Farm.removeAnimalFromAllLocations(panelTarget);
             * CowAppScript.currentAnimalList.Add(panelTarget);
             * CowAppScript.targetMenu = CowAppScript.requestingMenu;*/
            break;

        case 3:
            Farm.removeAnimal(panelTarget);
            CowAppScript.listMode = 1;
            CowAppScript.getCurrentMenu().refreshMenu();
            break;

        case 4:
            CowAppScript.currentFocusLocation.removeAnimalFromLocation(panelTarget);
            CowAppScript.listMode = 1;
            break;
        }
    }
示例#4
0
    //------------------------ Buttons ------------------------
    public void submit()
    {
        bool allowCreation = true;

        foreach (Animal animal in Farm.getAnimals())
        {
            if (animal.getFullID() == IDInputField.text)
            {
                allowCreation = false;
            }
        }
        if (allowCreation)
        {
            Animal a = new Animal(new SINumber(IDInputField.text), NameInputField.text);
            if (selectedMother != null)
            {
                a.setMother(selectedMother.getID());
                selectedMother.addChild(a);
            }
            if (selectedFather != null)
            {
                a.setFather(selectedFather.getID());
                selectedFather.addChild(a);
            }
            if (selectedLocation != null)
            {
                a.setLocation(selectedLocation);
            }
            Farm.addAnimal(a);
            CowAppScript.changeMenu(1);
        }
    }
示例#5
0
    //------------ Input checking ----

    public void onSIinputField()
    {
        if (!CowAppScript.confirmSIFormat(IDInputField.text))
        {
            CowAppScript.activateTextPrompt("Var god mata in SI-Nummret på formatet: SE-123456-1234-1");
            IDInputField.text = "";
        }
    }
示例#6
0
    private void resolveRequestLocation()
    {
        isRequestingLocation = false;
        CowAppScript.changeMenu(menuIDvalue);
        Location l = CowAppScript.getRequestedLocation();

        selectedLocation = l;
        CowAppScript.requestedLocation = null;
        refreshMenu();
    }
示例#7
0
    private void resolveRequestFather()
    {
        isRequestingFather = false;
        CowAppScript.changeMenu(menuIDvalue);
        Animal a = CowAppScript.getRequestedAnimal();

        selectedFather = a;
        CowAppScript.requestedAnimal = null;
        refreshMenu();
    }
示例#8
0
    //------------------------ Buttons ------------------------
    public void submitButton()
    {
        bool allowCreation = true;

        foreach (Location loc in Farm.getLocations())
        {
            if (loc.getName() == nameInputField.text)
            {
                allowCreation = false;
            }
        }
        if (allowCreation)
        {
            Location l = new Location(nameInputField.text);
            Farm.addLocation(l);
            CowAppScript.changeMenu(2);
        }
    }
示例#9
0
 public void backButton()
 {
     CowAppScript.changeMenu(2);
 }
示例#10
0
 public void backButton()
 {
     CowAppScript.listMode = 1;
     CowAppScript.changeMenuBack();
 }
示例#11
0
 public void newLocationButton()
 {
     CowAppScript.changeMenu(6);
 }
示例#12
0
 private void startRequestMother()
 {
     isRequestingMother = true;
     CowAppScript.startRequestAnimal(menuIDvalue);
 }
示例#13
0
 private void startRequestLocation()
 {
     isRequestingLocation = true;
     CowAppScript.startRequestLocation(menuIDvalue);
 }