public void addAnimalButton() { CowAppScript.requestingMenu = 4; CowAppScript.listMode = 2; CowAppScript.currentAnimalList = CowAppScript.currentFocusLocation.getAnimalsAtLocation(); CowAppScript.changeMenu(1); }
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; } }
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; } }
//------------------------ 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); } }
private void resolveRequestLocation() { isRequestingLocation = false; CowAppScript.changeMenu(menuIDvalue); Location l = CowAppScript.getRequestedLocation(); selectedLocation = l; CowAppScript.requestedLocation = null; refreshMenu(); }
private void resolveRequestFather() { isRequestingFather = false; CowAppScript.changeMenu(menuIDvalue); Animal a = CowAppScript.getRequestedAnimal(); selectedFather = a; CowAppScript.requestedAnimal = null; refreshMenu(); }
//------------------------ 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); } }
public void backButton() { CowAppScript.changeMenu(2); }
public void backButton() { CowAppScript.listMode = 1; CowAppScript.changeMenu(0); }
public void newLocationButton() { CowAppScript.changeMenu(6); }