static void Main(string[] args) { ICinema cinema = CreateCinema(CinemaType.flat, EquipmentType.ZWave); cinema.Show(); cinema.Stop(); cinema.Off(); Console.WriteLine("-----------------------------"); cinema = CreateCinema(CinemaType.flat, EquipmentType.Noolite); cinema.Show(); cinema.Stop(); cinema.Off(); Console.WriteLine("-----------------------------"); cinema = CreateCinema(CinemaType.cottadge, EquipmentType.ZWave); cinema.Show(); cinema.Stop(); cinema.Off(); Console.WriteLine("-----------------------------"); cinema = CreateCinema(CinemaType.cottadge, EquipmentType.Noolite); cinema.Show(); cinema.Stop(); cinema.Off(); Console.ReadKey(); }
public void Run() { ICinema cinema = CreateCinema(); cinema.Show(); cinema.Stop(); cinema.Off(); }
public void Update(IBaseModel model) { ICinema cinema = (ICinema)model; this.Id = cinema.Id; this.CityId = cinema.CityId; this.CinName = cinema.CinName; this.CinAddress = cinema.CinAddress; this.CinIcon = cinema.CinIcon; }
public void Cinema_FlatZwave_result() { ICinema cinema = CreateCinema(CinemaType.flat, EquipmentType.ZWave); _output.WriteLine(cinema.Show()); _output.WriteLine("-----------------------------"); _output.WriteLine(cinema.Stop()); _output.WriteLine("-----------------------------"); _output.WriteLine(cinema.Off()); }
public async Task <NewSummary> New(ICinemaCreation model) { ICinema cinema = await this.cinemaRepo.GetByNameAndAddress(model.Name, model.Address); if (cinema != null) { return(new NewSummary(false, StringConstants.CinemaExists)); } return(await newCinema.New(model)); }
public async Task Add(ICinema cinema) { await cinemaService.addCinemaAsync(new addCinemaRequest { citIdSpecified = true, citId = cinema.CityId, cinName = cinema.CinName, cinAddress = cinema.CinAddress, cinIcon = cinema.CinIcon }); }
public IHttpActionResult Index(CinemaCreationModel model) { ICinema cinema = cinemaRepo.GetByNameAndAddress(model.Name, model.Address); if (cinema == null) { cinemaRepo.Insert(new Cinema(model.Name, model.Address)); return(Ok()); } return(BadRequest("Cinema already exists")); }
public async Task <ICinema> Merge(ICinema cinema) { var result = await this.cinemaService.mergeCinemaAsync(new mergeCinemaRequest { citId = cinema.CityId, cinId = cinema.Id, cinName = cinema.CinName, cinAddress = cinema.CinAddress, cinIcon = cinema.CinIcon, cinIdSpecified = true, citIdSpecified = true }); return(this.ToCinema(result.@return)); }
public void Preload(BaseMonoAvatar aMonoAvatar) { ConfigAvatar config = aMonoAvatar.config; if (config.CinemaPaths.Count != 0) { foreach (KeyValuePair <AvatarCinemaType, string> pair in config.CinemaPaths) { string key = pair.Value; if (!this._loadedCinemaData.ContainsKey(key)) { ICinema component = UnityEngine.Object.Instantiate <GameObject>(Miscs.LoadResource <GameObject>(key, BundleType.RESOURCE_FILE)).GetComponent <MonoBehaviour>() as ICinema; component.GetCutscene().Optimize(); this._loadedCinemaData.Add(key, component); } } } }
public async Task <IHttpActionResult> Create(CinemaCreationModel model) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } ICinema cinema = await cinemaRepo.GetByNameAndAddressAsync(model.Name, model.Address); if (cinema == null) { await cinemaRepo.InsertAsync(new Cinema(model.Name, model.Address)); return(Ok()); } return(BadRequest("Cinema already exists")); }
public void Attach(ICinema cinema) { _cinemas.Add(cinema); }
public override bool Equals(object city) { ICinema cinemaToCompare = city as ICinema; return(cinemaToCompare != null && this.Id.Equals(cinemaToCompare.Id)); }
static void Main(string[] args) { Parser.Default.ParseArguments <Options>(args).WithParsed <Options>(o => { ICinema cinema = o.City switch { City.Basel => new BaselCinema(), City.Bern => new BernCinema(), City.Geneva => new GenevaCinema(), City.LausanneFlo => new LausanneFloCinema(), City.LausanneGal => new LausanneGalCinema(), City.Lucerne => new LucerneCinema(), City.Spreitenbach => new SpreitenbachCinema(), City.Zurich => new ZurichCinema(), _ => new GenevaCinema() }; /* Retrieve from pathe.ch upcoming movies */ RestClient client = new RestClient("https://pathe.ch/solr/pathe-movies"); IRestRequest upcomingRequest = new RestRequest("upcoming?{fq}", Method.GET).AddParameter("fq", $"site:({cinema.Site})"); IRestResponse <UpcomingApi.Upcoming> upcomingResponse = client.Execute <UpcomingApi.Upcoming>(upcomingRequest); /* Maybe the user has no internet or an error occured during deserialization */ if (!upcomingResponse.IsSuccessful || upcomingResponse.Data == null) { Console.Error.WriteLine($"An error occured during the upcoming request ({upcomingResponse.ErrorMessage})."); return; } if (upcomingResponse.Data.Response.Docs.Count == 0) { Console.Error.WriteLine($"No upcoming movie for the cinema in {o.City}."); return; } /* Retrieve details for all upcoming movies */ IRestRequest detailRequest = new RestRequest("detail?{fq}").AddParameter("fq", $"id:({String.Join(" ", upcomingResponse.Data.Response.Docs.Select(m => m.MovieId).ToArray())})"); IRestResponse <DetailApi.Detail> detailResponse = client.Execute <DetailApi.Detail>(detailRequest); /* Maybe the user has no internet or an error occured during deserialization */ if (!detailResponse.IsSuccessful || detailResponse.Data == null) { Console.Error.WriteLine($"An error occured during the detail request ({detailResponse.ErrorMessage})."); return; } if (detailResponse.Data.Response.Docs.Count == 0) { Console.Error.WriteLine($"No description retrieved for {o.City} cinema films."); return; } Calendar calendar = new Calendar(); foreach (DetailApi.Doc doc in detailResponse.Data.Response.Docs) { CalendarEvent calendarEvent = new CalendarEvent(); switch (o.Language) { case Language.De: calendarEvent.Summary = doc.TitleDe; calendarEvent.Description = doc.SynopsisDe; break; case Language.En: calendarEvent.Summary = doc.Title; calendarEvent.Description = doc.SynopsisEn; break; case Language.Fr: calendarEvent.Summary = doc.TitleFr; calendarEvent.Description = doc.SynopsisFr; break; } ; switch (o.City) { case City.Basel: calendarEvent.Start = new CalDateTime(doc.ReleaseDeCh.Value.DateTime); calendarEvent.End = new CalDateTime(doc.ReleaseDeCh.Value.DateTime); break; case City.Bern: calendarEvent.Start = new CalDateTime(doc.ReleaseDeCh.Value.DateTime); calendarEvent.End = new CalDateTime(doc.ReleaseDeCh.Value.DateTime); break; case City.Geneva: calendarEvent.Start = new CalDateTime(doc.ReleaseFrCh.Value.DateTime); calendarEvent.End = new CalDateTime(doc.ReleaseFrCh.Value.DateTime); break; case City.LausanneFlo: calendarEvent.Start = new CalDateTime(doc.ReleaseFrCh.Value.DateTime); calendarEvent.End = new CalDateTime(doc.ReleaseFrCh.Value.DateTime); break; case City.LausanneGal: calendarEvent.Start = new CalDateTime(doc.ReleaseFrCh.Value.DateTime); calendarEvent.End = new CalDateTime(doc.ReleaseFrCh.Value.DateTime); break; case City.Lucerne: calendarEvent.Start = new CalDateTime(doc.ReleaseDeCh.Value.DateTime); calendarEvent.End = new CalDateTime(doc.ReleaseDeCh.Value.DateTime); break; case City.Spreitenbach: calendarEvent.Start = new CalDateTime(doc.ReleaseDeCh.Value.DateTime); calendarEvent.End = new CalDateTime(doc.ReleaseDeCh.Value.DateTime); break; case City.Zurich: calendarEvent.Start = new CalDateTime(doc.ReleaseDeCh.Value.DateTime); calendarEvent.End = new CalDateTime(doc.ReleaseDeCh.Value.DateTime); break; } calendarEvent.Location = cinema.Address; calendarEvent.GeographicLocation = new GeographicLocation(cinema.Latitude, cinema.Longitude); string vimeoId = o.TrailerLanguage switch { TrailerLanguage.De => !string.IsNullOrEmpty(doc.TrailerEmbedDe) ? doc.TrailerEmbedDe.Remove(0, 1) : "", TrailerLanguage.Ov => !string.IsNullOrEmpty(doc.TrailerEmbedOv) ? doc.TrailerEmbedOv.Remove(0, 1) : "", TrailerLanguage.Fr => !string.IsNullOrEmpty(doc.TrailerEmbedFr) ? doc.TrailerEmbedFr.Remove(0, 1) : "", _ => "" }; if (!string.IsNullOrEmpty(o.VimeoBypassUrl) && !string.IsNullOrEmpty(vimeoId)) { calendarEvent.Url = new Uri($"{o.VimeoBypassUrl}?v={vimeoId}"); } calendar.Events.Add(calendarEvent); } CalendarSerializer serializer = new CalendarSerializer(); string serializedCalendar = serializer.SerializeToString(calendar); try { File.WriteAllText(o.Output, serializedCalendar); Console.WriteLine($"Calendar has been exported to '{o.Output}'."); } catch (Exception ex) { Console.Error.WriteLine(ex.Message); } }); }
private bool FilterCinemas(ICinema cinema) { return(this.citiesView.Selected != null && cinema.CityId == this.citiesView.Selected.Id); }
public void Detach(ICinema cinema) { _cinemas.Remove(cinema); }
public void TransitToCinema(ICinema cinema) { this.cinemaState.SetCinema(cinema); this.Transit(this.cinemaState); }
public void SetCinema(ICinema cinema) { this._cinema = cinema; }