示例#1
0
    protected IEnumerator ArriveBathroom(Bathroom place)
    {
        UpdateHeader(" entering bathroom");

        // Get toilet.
        Waitpoint toilet = FindRandomWaitpoint(place.toilets, true);

        yield return(StartCoroutine(WaitpointQueue(toilet)));

        PlaySFX(fX.pee);
        yield return(StartCoroutine("UseHands"));

        toilet.IsBusy = false;

        // Get sink.
        Waitpoint sink = FindRandomWaitpoint(place.sinks, true);

        yield return(StartCoroutine(WaitpointQueue(sink)));

        PlaySFX(fX.tap);
        yield return(StartCoroutine("UseHands"));

        sink.IsBusy = false;

        isBusy = false;

        SetIdle();
    }
示例#2
0
文件: Elsa.cs 项目: ClaseIA/finalIA
    // Use this for initialization
    void Start()
    {
        InitMinerData();

        // Hay que hacer la fsm del agente
        fsm = new FSM(gameObject, this);

        // Crear los estados en que puede estar
        Cooking   cook = new Cooking(this);
        Bathroom  bath = new Bathroom(this);
        Housework work = new Housework(this);

        // Asignarle a cada estado los eventos que puede tener
        //work.AddEvent(EventList.events.imHome);

        // Hay que agregarlos a la FSM
        fsm.AddState(StateID.Cooking, cook);
        fsm.AddState(StateID.Bathroom, bath);
        fsm.AddState(StateID.DoHousework, work);

        // Indicar cual es el estado inicial
        fsm.ChangeState(StateID.DoHousework);

        // Activo la fsm
        fsm.Activate();
    }
        public ActionResult DeleteConfirmed(int id)
        {
            Bathroom bathroom = db.Bathrooms.Find(id);

            db.Bathrooms.Remove(bathroom);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
        public void Put(int id, [FromBody] Bathroom updatedBathroom)
        {
            var bathroom = m_BathroomStore.GetById(id);

            bathroom.IsOpened = updatedBathroom.IsOpened;
            m_BathroomStore.Update(bathroom);

            m_Hub.Clients.All.Update(bathroom);
        }
        public void AddBathroomAuctions(string nameText, string used, double price)
        {
            Bathroom newBathroom = new Bathroom();

            newBathroom.Name     = nameText;
            newBathroom.Price    = price;
            newBathroom.Category = Category.BathRoom;
            newBathroom.ItemUsed = used;
            auctionList.Add(newBathroom);
        }
        public Stall StallStatusGet(int id, bool occupied)
        {
            Stall status = new Stall();

            status.id       = id;
            status.occupied = occupied;
            Stall.UpdateStatus(status);                            //store update
            BathroomInfoController.bathrooms = Bathroom.LoadAll(); //reload bathroom data
            return(status);
        }
 public ActionResult Edit([Bind(Include = "BathroomID,HouseholdID,BathroomTypeID,BathroomQuantity,ToiletQuantity,SingleToiletQuantity,DualToiletQuantity,Electric,Power,Mixer,Unknown,Round,Threaded,NonThreaded,Other,UpdateDate")] Bathroom bathroom)
 {
     if (ModelState.IsValid)
     {
         db.Entry(bathroom).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.BathroomTypeID = new SelectList(db.BathroomTypes, "BathroomTypeID", "Type", bathroom.BathroomTypeID);
     ViewBag.HouseholdID    = new SelectList(db.Households, "HouseholdID", "WPnumber", bathroom.HouseholdID);
     return(View(bathroom));
 }
        void ReleaseDesignerOutlets()
        {
            if (Bathroom != null)
            {
                Bathroom.Dispose();
                Bathroom = null;
            }

            if (ResetTimer != null)
            {
                ResetTimer.Dispose();
                ResetTimer = null;
            }
        }
示例#9
0
    /*public int getBooth()
     * {
     *  int patate = Random.Range(0, allBooths.Count);
     *  int boothToSend = allBooths[patate];
     *  allBooths.RemoveAt(patate);
     *
     *  return boothToSend;
     * }*/

    public BaseBooth getFaceDowbBooth()
    {
        int patate = Random.Range(0, allBooths.Count);
        int boothToSendFaceDown = allBooths[patate];

        allBooths.RemoveAt(patate);

        switch (boothToSendFaceDown)
        {
        case 0:
            Debug.Log("Restaurant,This restaurant adds 1 visitor to your parc and generate 2 $ per turn.");
            Restaurant restaurant = new Restaurant();
            restaurant.turnOver();
            return(restaurant);

        case 1:
            Debug.Log("Security, This guard is securing your park against dinosaur breaches.");
            Security security = new Security();
            security.turnOver();
            return(security);

        case 2:
            Debug.Log("Bathroom, This clean new bathroom brings 3 new visitors around your park.");
            Bathroom bathroom = new Bathroom();
            bathroom.turnOver();
            return(bathroom);

        case 3:
            Debug.Log("Casino, This arcade helps you generate 3 $ per turn.");
            Casino casino = new Casino();
            casino.turnOver();
            return(casino);

        case 4:
            Debug.Log("Spy, You have recruited ingenious spies to clone one of your enemy's dinosaur (single use effect).");
            Spy spy = new Spy();
            spy.turnOver();
            return(spy);

        case 5:
            Debug.Log("Paleontologist, You have recruited a wise paleontologist! He will help you counter some unfortunate events that could ruin your park.");
            Paleontologist paleontologist = new Paleontologist();
            paleontologist.turnOver();
            return(paleontologist);

        default:
            Debug.Log("invalid boothId");
            return(null);
        }
    }
示例#10
0
        static void Main()
        {
            var clock     = new CountdownClock();
            var bath      = new Bathroom();
            var microwave = new Microwave();

            bath.Register(clock);
            microwave.Register(clock);
            Console.WriteLine("The countdown has begun!");
            clock.ImitationCountdownClock(5);
            bath.Unregister(clock);
            clock.ImitationCountdownClock(2);
            Console.ReadKey();
        }
        // GET: Bathrooms/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Bathroom bathroom = db.Bathrooms.Find(id);

            if (bathroom == null)
            {
                return(HttpNotFound());
            }
            return(View(bathroom));
        }
示例#12
0
 public void Set(PropertyType propertyType, Bed minBeds, int minLand, Price minPrice, Price maxPrice, Location location, ConstructionType constructionType, CarSpace minCarSpaces, Bathroom minBathrooms, Bed maxBeds, bool isIncludingSurroundingSuburbs, bool isExcludingPropertiesUnderContract)
 {
     this.propertyType     = propertyType;
     this.minBeds          = minBeds;
     this.minLand          = minLand;
     this.minPrice         = minPrice;
     this.maxPrice         = maxPrice;
     this.location         = location;
     this.constructionType = constructionType;
     this.minCarSpaces     = minCarSpaces;
     this.minBathrooms     = minBathrooms;
     this.maxBeds          = maxBeds;
     this.isIncludingSurroundingSuburbs      = isIncludingSurroundingSuburbs;
     this.isExcludingPropertiesUnderContract = isExcludingPropertiesUnderContract;
 }
        public ActionResult Create([Bind(Include = "BathroomID,HouseholdID,BathroomTypeID,BathroomQuantity,ToiletQuantity,SingleToiletQuantity,DualToiletQuantity,Electric,Power,Mixer,Unknown,Round,Threaded,NonThreaded,Other,UpdateDate")] Bathroom bathroom, string returnUrl)
        {
            ViewBag.returnUrl = returnUrl;

            if (ModelState.IsValid)
            {
                db.Bathrooms.Add(bathroom);
                db.SaveChanges();
                return(Redirect(returnUrl));
            }

            ViewBag.BathroomTypeID = new SelectList(db.BathroomTypes, "BathroomTypeID", "Type", bathroom.BathroomTypeID);
            ViewBag.HouseholdID    = new SelectList(db.Households, "HouseholdID", "WPnumber", bathroom.HouseholdID);
            return(View(bathroom));
        }
示例#14
0
        static void Main(string[] args)
        {
            IVisitor       console   = new ConsoleVisitor();
            CounterVisitor counter   = new CounterVisitor();
            IRoom          kitchen   = new Kitchen();
            IRoom          bathroom  = new Bathroom();
            IRoom          apartment = new Apartment();

            kitchen.Accept(counter);
            bathroom.Accept(console);
            apartment.Accept(counter);

            console.Visit((Kitchen)kitchen);
            counter.PublishCounter();
        }
        // GET: Bathrooms/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Bathroom bathroom = db.Bathrooms.Find(id);

            if (bathroom == null)
            {
                return(HttpNotFound());
            }
            ViewBag.BathroomTypeID = new SelectList(db.BathroomTypes, "BathroomTypeID", "Type", bathroom.BathroomTypeID);
            ViewBag.HouseholdID    = new SelectList(db.Households, "HouseholdID", "WPnumber", bathroom.HouseholdID);
            return(View(bathroom));
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            // Perform any additional setup after loading the view, typically from a nib.

            Stopwatch startTime = new Stopwatch();
            TimeSpan  stopTime  = new TimeSpan();

            bool pressed = false;
            int  count   = 0;

            Bathroom.TouchUpInside += (object sender, EventArgs e) =>
            {
                count++;
                if (count == 1)
                {
                    startTime = KeepTime.StartTimer();
                    Bathroom.BackgroundColor = UIColor.Red;
                    Bathroom.SetTitle($"Counting...", UIControlState.Normal);
                }
                if (count == 2)
                {
                    count     = count - 2;
                    stopTime += KeepTime.StopTimer(startTime);
                    string elapsedTime = String.Format("{0:00}:{1:00}:{2:00}.{3:00}",
                                                       stopTime.Hours, stopTime.Minutes, stopTime.Seconds,
                                                       stopTime.Milliseconds / 10);
                    Bathroom.BackgroundColor = UIColor.SystemGreenColor;
                    Bathroom.SetTitle($"Bathroom - {elapsedTime}", UIControlState.Normal);
                }
            };

            ResetTimer.TouchUpInside += (object sender, EventArgs e) =>
            {
                stopTime = TimeSpan.Zero;
                string elapsedTime = "00:00:00:00";
                Bathroom.SetTitle($"Bathroom - {elapsedTime}", UIControlState.Normal);
            };
        }
示例#17
0
 public string GetMinBathroomsQuery(Bathroom minBathrooms)
 {
     return(string.Concat("numBaths=", Bathrooms[minBathrooms]));
 }
示例#18
0
        public string GetParameters(ConstructionType constructionType, CarSpace minCarSpaces, Bathroom minBathrooms, Bed minBeds, Bed maxBeds, bool isIncudingSurroundingSuburbs, bool isExcludingPropertiesUnderContract, string source)
        {
            var parameters = "?";

            if (constructionType != ConstructionType.Any)
            {
                parameters += GetConstructionTypeQuery(constructionType);
                parameters += "&";
            }

            if (minCarSpaces != CarSpace.Any)
            {
                parameters += GetMinCarSpacesQuery(minCarSpaces);
                parameters += "&";
            }

            if (minBathrooms != Bathroom.Any)
            {
                parameters += GetMinBathroomsQuery(minBathrooms);
                parameters += "&";
            }

            if (minBeds != Bed.Any)
            {
                parameters += GetMaxBedsQuery(maxBeds);
                parameters += "&";
            }

            if (!isIncudingSurroundingSuburbs)
            {
                parameters += GetSurroundingSuburbsQuery();
                parameters += "&";
            }

            if (isExcludingPropertiesUnderContract)
            {
                parameters += GetPropertiesUnderContractQuery();
                parameters += "&";
            }

            parameters += GetSourceQuery(source);

            return(parameters);
        }
示例#19
0
 public void Visit(Bathroom room)
 {
     room.Clean();
 }
        void IBathroomStore.Update(Bathroom bathroom)
        {
            var index = m_DB.IndexOf(bathroom);

            m_DB[index] = bathroom;
        }
示例#21
0
    void CompileLists()
    {
        // Find all places and add them to correct list.
        foreach (var p in GameObject.FindGameObjectsWithTag("Place"))
        {
            switch (p.GetComponent <Place>().placeType)
            {
            case Place.PlaceType.hall:
                hall = p.GetComponent <Place>();
                break;

            case Place.PlaceType.cafeteria:
                cafeteria = p.GetComponent <Cafeteria>();
                break;

            case Place.PlaceType.kitchen:
                kitchen = p.GetComponent <Kitchen>();
                break;

            case Place.PlaceType.cell:
                cells.Add(p.GetComponent <Cell>());
                break;

            // Bathrooms.
            case Place.PlaceType.bathroomCentre:
                bathroomCentre = p.GetComponent <Bathroom>();
                bathRooms.Add(p.GetComponent <Bathroom>());
                p.GetComponent <Place>().added = true;
                break;

            case Place.PlaceType.bathroomEast:
                bathroomEast = p.GetComponent <Bathroom>();
                bathRooms.Add(p.GetComponent <Bathroom>());
                break;

            case Place.PlaceType.bathroomWest:
                bathroomWest = p.GetComponent <Bathroom>();
                bathRooms.Add(p.GetComponent <Bathroom>());
                break;

            case Place.PlaceType.shower:
                showerRooms.Add(p.GetComponent <Place>());
                break;

            // Therapy Rooms
            case Place.PlaceType.therapy1:
                therapy1 = p.GetComponent <Therapy>();
                break;

            case Place.PlaceType.therapy2:
                therapy2 = p.GetComponent <Therapy>();
                break;

            case Place.PlaceType.therapy3:
                therapy3 = p.GetComponent <Therapy>();
                break;

            case Place.PlaceType.therapy4:
                therapy4 = p.GetComponent <Therapy>();
                break;

            case Place.PlaceType.therapy5:
                therapy5 = p.GetComponent <Therapy>();
                break;

            case Place.PlaceType.therapy6:
                therapy6 = p.GetComponent <Therapy>();
                break;

            // Other rooms.
            case Place.PlaceType.dayRoom:
                dayRoom = p.GetComponent <DayRoom>();
                break;

            // Staff
            case Place.PlaceType.pharmacy:
                pharmacy = p.GetComponent <Pharmacy>();
                break;

            case Place.PlaceType.records:
                records = p.GetComponent <Records>();
                break;

            case Place.PlaceType.office:
                office = p.GetComponent <Office>();
                break;

            case Place.PlaceType.staffRoom:
                staffroom = p.GetComponent <StaffRoom>();
                break;

            case Place.PlaceType.staffQuarters:
                staffquarters = p.GetComponent <StaffQuarters>();
                break;

            default:
                break;
            }
            p.GetComponent <Place>().added = true;
        }
    }
 public Stall PutStallStatus(Stall status)
 {
     Stall.UpdateStatus(status);                            //store update
     BathroomInfoController.bathrooms = Bathroom.LoadAll(); //reload bathroom data
     return(status);
 }
示例#23
0
 public void Visit(Bathroom room)
 {
     this.ServiceCost += BathroomPrice;
 }
示例#24
0
 public BathroomModel(Bathroom b)
 {
     Id_Bathroom   = b.Id_Bathroom;
     Bathroom_Name = b.Bathroom_Name;
 }
示例#25
0
 public void Visit(Bathroom room)
 {
     room.Repair();
 }
        private void InitialiseKeyboard(IWindowManipulationService windowManipulationService)
        {
            if (Settings.Default.ConversationOnlyMode)
            {
                Keyboard = new ConversationAlpha(null);
                windowManipulationService.Maximise();
            }
            else
            {
                switch (Settings.Default.StartupKeyboard)
                {
                case Enums.Keyboards.Alpha:
                    Keyboard = new Alpha();
                    windowManipulationService.Restore();
                    mainWindowManipulationService.ResizeDockToFull();
                    windowManipulationService.Maximise();
                    break;

                case Enums.Keyboards.ConversationAlpha:
                    Keyboard = new ConversationAlpha(() =>
                    {
                        Keyboard = new Menu(() => Keyboard = new Alpha());
                        mainWindowManipulationService.Restore();
                        mainWindowManipulationService.ResizeDockToFull();
                    });
                    windowManipulationService.Maximise();
                    break;

                case Enums.Keyboards.ConversationNumericAndSymbols:
                    Keyboard = new ConversationNumericAndSymbols(() =>
                    {
                        Keyboard = new Menu(() => Keyboard = new Alpha());
                        mainWindowManipulationService.Restore();
                        mainWindowManipulationService.ResizeDockToFull();
                    });
                    windowManipulationService.Maximise();
                    break;

                case Enums.Keyboards.Currencies1:
                    Keyboard = new Currencies1();
                    windowManipulationService.Restore();
                    mainWindowManipulationService.ResizeDockToFull();
                    break;

                case Enums.Keyboards.Currencies2:
                    Keyboard = new Currencies2();
                    windowManipulationService.Restore();
                    mainWindowManipulationService.ResizeDockToFull();
                    break;

                case Enums.Keyboards.Diacritics1:
                    Keyboard = new Diacritics1();
                    windowManipulationService.Restore();
                    mainWindowManipulationService.ResizeDockToFull();
                    break;

                case Enums.Keyboards.Diacritics2:
                    Keyboard = new Diacritics2();
                    windowManipulationService.Restore();
                    mainWindowManipulationService.ResizeDockToFull();
                    break;

                case Enums.Keyboards.Diacritics3:
                    Keyboard = new Diacritics3();
                    windowManipulationService.Restore();
                    mainWindowManipulationService.ResizeDockToFull();
                    break;

                case Enums.Keyboards.Food:
                    Keyboard = new Food();
                    windowManipulationService.Restore();
                    mainWindowManipulationService.ResizeDockToFull();
                    break;

                case Enums.Keyboards.Menu:
                    Keyboard = new Menu(() => Keyboard = new Alpha());
                    windowManipulationService.Restore();
                    mainWindowManipulationService.ResizeDockToFull();
                    break;

                case Enums.Keyboards.Minimised:
                    Keyboard = new Minimised(() =>
                    {
                        Keyboard = new Menu(() => Keyboard = new Alpha());
                        windowManipulationService.Restore();
                        mainWindowManipulationService.ResizeDockToFull();
                    });
                    windowManipulationService.Minimise();
                    break;

                case Enums.Keyboards.Mouse:
                    Keyboard = new Mouse(() => Keyboard = new Menu(() => Keyboard = new Alpha()));
                    windowManipulationService.Restore();
                    if (Settings.Default.MouseKeyboardDockSize == DockSizes.Full)
                    {
                        mainWindowManipulationService.ResizeDockToFull();
                    }
                    else
                    {
                        mainWindowManipulationService.ResizeDockToCollapsed();
                    }
                    break;

                case Enums.Keyboards.NumericAndSymbols1:
                    Keyboard = new NumericAndSymbols1();
                    windowManipulationService.Restore();
                    mainWindowManipulationService.ResizeDockToFull();
                    break;

                case Enums.Keyboards.NumericAndSymbols2:
                    Keyboard = new NumericAndSymbols2();
                    windowManipulationService.Restore();
                    mainWindowManipulationService.ResizeDockToFull();
                    break;

                case Enums.Keyboards.NumericAndSymbols3:
                    Keyboard = new NumericAndSymbols3();
                    windowManipulationService.Restore();
                    mainWindowManipulationService.ResizeDockToFull();
                    break;

                case Enums.Keyboards.PhysicalKeys:
                    Keyboard = new PhysicalKeys();
                    windowManipulationService.Restore();
                    mainWindowManipulationService.ResizeDockToFull();
                    break;

                case Enums.Keyboards.SizeAndPosition:
                    Keyboard = new SizeAndPosition(() => Keyboard = new Menu(() => Keyboard = new Alpha()));
                    windowManipulationService.Restore();
                    mainWindowManipulationService.ResizeDockToFull();
                    break;

                case Enums.Keyboards.emotionKeyboardKeyboard:
                    Keyboard = new emotionKeyboard();
                    windowManipulationService.Restore();
                    mainWindowManipulationService.ResizeDockToFull();
                    break;

                case Enums.Keyboards.PeopleKeyboard:
                    Keyboard = new People();
                    windowManipulationService.Restore();
                    mainWindowManipulationService.ResizeDockToFull();
                    break;

                case Enums.Keyboards.SportKeyboard:
                    Keyboard = new Sport();
                    windowManipulationService.Restore();
                    mainWindowManipulationService.ResizeDockToFull();
                    break;

                case Enums.Keyboards.CountriesKeyboard:
                    Keyboard = new Countries();
                    windowManipulationService.Restore();
                    mainWindowManipulationService.ResizeDockToFull();
                    break;

                case Enums.Keyboards.PlacesKeyboard:
                    Keyboard = new Places();
                    windowManipulationService.Restore();
                    mainWindowManipulationService.ResizeDockToFull();
                    break;

                case Enums.Keyboards.WeatherKeyboard:
                    Keyboard = new Weather();
                    windowManipulationService.Restore();
                    mainWindowManipulationService.ResizeDockToFull();
                    break;

                case Enums.Keyboards.BathroomKeyboard:
                    Keyboard = new Bathroom();
                    windowManipulationService.Restore();
                    mainWindowManipulationService.ResizeDockToFull();
                    break;

                case Enums.Keyboards.HouseholdKeyboard:
                    Keyboard = new Household();
                    windowManipulationService.Restore();
                    mainWindowManipulationService.ResizeDockToFull();
                    break;

                case Enums.Keyboards.ClothesKeyboard:
                    Keyboard = new Clothes();
                    windowManipulationService.Restore();
                    mainWindowManipulationService.ResizeDockToFull();
                    break;

                case Enums.Keyboards.EntertainmentKeyboard:
                    Keyboard = new Entertainment();
                    windowManipulationService.Restore();
                    mainWindowManipulationService.ResizeDockToFull();
                    break;

                case Enums.Keyboards.TimeKeyboard:
                    Keyboard = new Time();
                    windowManipulationService.Restore();
                    mainWindowManipulationService.ResizeDockToFull();
                    break;

                case Enums.Keyboards.GesturesKeyboard:
                    Keyboard = new Gestures();
                    windowManipulationService.Restore();
                    mainWindowManipulationService.ResizeDockToFull();
                    break;

                case Enums.Keyboards.AnimalsKeyboard:
                    Keyboard = new Animals();
                    windowManipulationService.Restore();
                    mainWindowManipulationService.ResizeDockToFull();
                    break;

                case Enums.Keyboards.DrinksKeyboard:
                    Keyboard = new Drinks();
                    windowManipulationService.Restore();
                    mainWindowManipulationService.ResizeDockToFull();
                    break;

                case Enums.Keyboards.FruitsKeyboard:
                    Keyboard = new Fruits();
                    windowManipulationService.Restore();
                    mainWindowManipulationService.ResizeDockToFull();
                    break;

                case Enums.Keyboards.VegetablesKeyboard:
                    Keyboard = new Vegetables();
                    windowManipulationService.Restore();
                    mainWindowManipulationService.ResizeDockToFull();
                    break;
                }
            }
        }
 public void Update(Bathroom bathroom)
 {
     Clients.All.Update(bathroom);
 }