//获得演员,信息照片都获取 public async void GetActorList() { CurrentActorPage = 1; TextType = "演员"; cdb = new DataBase(); List <Actress> models = null; await Task.Run(() => { models = cdb.SelectActorByVedioType(VedioType); }); await Task.Run(() => { cdb.CloseDB(); if (ActorList != null && models != null && models.Count == ActorList.ToList().Count) { return; } ActorList = new ObservableCollection <Actress>(); models?.ForEach(arg => { App.Current.Dispatcher.Invoke((Action) delegate { ActorList.Add(arg); }); }); TotalActorPage = (int)Math.Ceiling((double)ActorList.Count / (double)Properties.Settings.Default.ActorDisplayNum); ActorFlipOver(); }); }
public void RunGameLoopOnce() { // Process player actions Players.ForEach(player => { if (player.IsKilled) { if (player.DeathTimer++ < Constants.DeathTimeLimit) { return; } RespawnPlayer(player); } if (player.ActionType == null) { return; } player.ActionType.Process(player, this); player.ActionType = null; }); // Process all Actors ActorList.ForEach(actor => actor.Process(this)); // Move bullets forward by one BulletList.ForEach(bullet => bullet.Process(this)); // Remove dead shots List <Bullet> deadBullets = BulletList.Where(x => x.Collided == true).ToList(); deadBullets.ForEach(x => BulletList.Remove(x)); }
public Actor(ActorList id, string firstName, string lastName, EmotionSprites emotions) { Id = id; FirstName = firstName; LastName = lastName; Emotions = emotions; }
public new void Update() { string filterName = ActorFilter.Text; ActorList.BeginUpdate(); ActorList.DataSource = null; List <ActorMenuItem> menuItems = new List <ActorMenuItem>(); if (Reader.CanGetActors()) { ActorResult res = Reader.GetActors(); foreach (ActorItem item in res.CurrentPCs.Values) { if (!ExcludeActors.Contains(item.ID)) { if (!string.IsNullOrEmpty(filterName)) { if (!item.Name.ToLower().Contains(filterName.ToLower())) { continue; } } menuItems.Add(new ActorMenuItem { name = item.Name, id = (int)item.ID, }); } } } ActorList.DataSource = menuItems; ActorList.EndUpdate(); ActorList.Refresh(); }
protected void Page_Load(object sender, EventArgs e) { DataTable actors = new DataTable(); //Populate the drop down list if (!IsPostBack) { using (SqlConnection con = new SqlConnection(dbConn)) { try { SqlDataAdapter adapter = new SqlDataAdapter("SELECT actor_id, CONCAT(first_name, ' ', last_name) AS Result FROM actor", con); adapter.Fill(actors); ActorList.DataSource = actors; ActorList.DataValueField = "actor_id"; ActorList.DataTextField = "Result"; ActorList.DataBind(); } catch (SqlException ex) { ExceptionLabel.Text = "Unable to connect to Sakila database! Error message: " + ex.Message; } } } }
public async Task <IActionResult> Edit(int id, [Bind("Id,Name,Image")] ActorList actorList) { if (id != actorList.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(actorList); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ActorListExists(actorList.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(actorList)); }
public void TriggerConversation(ActorList actor) { if (actor == ActorList.BLOCKING_GUARD) { conversationManager.StartConversation(ConversationDatabase.BLOCKING_GUARD); } else if (actor == ActorList.DETECTIVE) { if (FlagManager.Instance.FIRST_MET_DETECTIVE_CORONER) { conversationManager.StartConversation(ConversationDatabase.DETECTIVE); } else { dialogueInitializer.TriggerDialogue(DialogueKeys.DETECTIVE_CORONER_INTRO, false); } } else if (actor == ActorList.CORONER) { if (FlagManager.Instance.FIRST_MET_DETECTIVE_CORONER) { conversationManager.StartConversation(ConversationDatabase.CORONER); } else { dialogueInitializer.TriggerDialogue(DialogueKeys.DETECTIVE_CORONER_INTRO, false); } } }
public async Task <IActionResult> PutActorList(int id, ActorList actorList) { if (id != actorList.Id) { return(BadRequest()); } _context.Entry(actorList).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ActorListExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <ActorList> > PostActorList(ActorList actorList) { _context.ActorList.Add(actorList); await _context.SaveChangesAsync(); return(CreatedAtAction("GetActorList", new { id = actorList.Id }, actorList)); }
T GetEntityByID <T>(Guid id) where T : IStoryEntityObject { if (typeof(IActor).IsAssignableFrom(typeof(T))) { var r = ActorList.FirstOrDefault(v => v.ObjectID == id); if (r == null) { return(default(T)); } return((T)r); } if (typeof(IEvent).IsAssignableFrom(typeof(T))) { var r = EventList.FirstOrDefault(v => v.ObjectID == id); if (r == null) { return(default(T)); } return((T)r); } if (typeof(IGroup).IsAssignableFrom(typeof(T))) { var r = GroupList.FirstOrDefault(v => v.ObjectID == id); if (r == null) { return(default(T)); } return((T)r); } if (typeof(IStuff).IsAssignableFrom(typeof(T))) { var r = StuffList.FirstOrDefault(v => v.ObjectID == id); if (r == null) { return(default(T)); } return((T)r); } if (typeof(ITask).IsAssignableFrom(typeof(T))) { var r = TaskList.FirstOrDefault(v => v.ObjectID == id); if (r == null) { return(default(T)); } return((T)r); } if (typeof(ILocation).IsAssignableFrom(typeof(T))) { var r = LocationList.FirstOrDefault(v => v.ObjectID == id); if (r == null) { return(default(T)); } return((T)r); } return(default(T)); }
public EditMessageViewModel() { Actors = Repository.Get(typeof(ActorList)) as ActorList; Msg = Repository.Get(typeof(SelectedMessage)) as SelectedMessage; Msg.OnChange.Subscribe(_ => { RaisePropertyChanged("Msg"); }); }
public ColorWarsGame(ColorWarsSettings settings) { this.settings = settings; this.playerList = new List <PlayerModel>(); this.playerControllersList = new List <PlayerController>(); this.gameBoard = new GameBoard(this.settings.StartingTerritorySize, this.settings.MapDimension); this.gameRenderer = new GameRenderer(new GraphicsDeviceManager(this), this.settings); this.gameActors = new ActorList(); this.scoreboard = new Scoreboard(this.playerList, this.gameBoard); }
// GET: ViewActorDetails public IActionResult ViewActorDetails() { var test = _context.Actor.ToList(); ActorList actorModel = new ActorList { ActorAll = test }; return(View(actorModel)); }
public async Task <IActionResult> Create([Bind("Id,Name,Image")] ActorList actorList) { if (ModelState.IsValid) { _context.Add(actorList); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(actorList)); }
private void LoadTemplates(string tagString, List <RdlActor> list, ActorList control) { List <RdlActor> actors = RdlTagCollection.FromString(tagString).GetActors(); if (actors.Count > 0) { list.Clear(); list.AddRange(actors); control.ItemsSource = list; } }
public List <IStoryEntityObject> GetAllEntityList() { var el = new List <IStoryEntityObject>(); ActorList.ForEach(v => el.Add(v)); GroupList.ForEach(v => el.Add(v)); EventList.ForEach(v => el.Add(v)); LocationList.ForEach(v => el.Add(v)); StuffList.ForEach(v => el.Add(v)); TaskList.ForEach(v => el.Add(v)); return(el); }
public List <string> GetAllParameterName() { List <string> l = new List <string>(); AddParameterName(ActorList.Cast <IStoryEntityObject>().ToList(), l); AddParameterName(EventList.Cast <IStoryEntityObject>().ToList(), l); AddParameterName(GroupList.Cast <IStoryEntityObject>().ToList(), l); AddParameterName(TaskList.Cast <IStoryEntityObject>().ToList(), l); AddParameterName(StuffList.Cast <IStoryEntityObject>().ToList(), l); AddParameterName(RelationList.Cast <IStoryEntityObject>().ToList(), l); return(l); }
// 會員離開房間 public bool Quit(int unique) { if (ActorList.ContainsKey(unique)) { if (ActorList[unique].CurState != RoomActorState.Gaming)//当前正在游戏则不能退出房间 { // InitRoomActorByIndex(unique); BoardcastActorInfo(unique); return(true); } } return(false); }
public IActionResult ViewActorDetails(int?Id) { if (Id == null) { return(NotFound()); } var test = _context.Actor.Where(a => a.ActorId == Id).ToList(); ActorList actorModel = new ActorList { ActorAll = test }; return(View(actorModel)); }
//Actors and Sensors private void LoadData() { simulator = new Simulator(modelItems); //modelItems-Liste wird an Simulator übergeben foreach (var item in simulator.Items) //enthält die generierten Demo-Daten aus dem Simulator { if (item.ItemType.Equals(typeof(ISensor))) { SensorList.Add(item); } else if (item.ItemType.Equals(typeof(IActuator))) { ActorList.Add(item); } } }
private void LoadData() { Simulator sim = new Simulator(modelItems); foreach (var item in sim.Items) { if (item.ItemType.Equals(typeof(ISensor))) { SensorList.Add(item); } else if (item.ItemType.Equals(typeof(IActuator))) { ActorList.Add(item); } } }
public void GenerateData() { sim = new Simulator(ModelList); foreach (var item in sim.Items) { if (item.ItemType.Equals(typeof(ISensor))) { SensorList.Add(item); } else if (item.ItemType.Equals(typeof(IActuator))) { ActorList.Add(item); } } }
public void CreateUseAndRemoveActorTest() { var player = new PlayerControllerMock(); var actors = new ActorList(); var mapping = new Dictionary <PlayerCommand, Keys> { { PlayerCommand.Up, Keys.A } }; var kState = new KeyboardState(Keys.A); actors.Actors.Add(new KeyboardActor(mapping, player)); actors.Actors[0].PollKeyboard(kState); Assert.IsTrue(player.DirChanged == 1); actors.RemoveActor(player.Player); Assert.IsTrue(actors.Actors.Count == 0); }
//DemoDaten laden private void LoadData() { Simulator sim = new Simulator(modelItems); //ueberpruefen ob Sensor oder Actor und zu Liste hinzufuegen foreach (var item in sim.Items) { if (item.ItemType.Equals(typeof(ISensor))) { SensorList.Add(item); } else if (item.ItemType.Equals(typeof(IActuator))) { ActorList.Add(item); } } }
//List<IRole> _RoleList = new List<IRole>(); //public List<IRole> RoleList { get { return _RoleList; } } public ICopySupportObject Clone() { var o = new Story() { Name = Name, Memo = Memo, BeginTime = BeginTime, EndTime = EndTime, Author = Author, StoryVersion = StoryVersion }; //o.CurrentUniverse = CurrentUniverse.Clone() as IUniverse; ActorList.ForEach(v => o.ActorList.Add(v.Clone() as IActor)); StuffList.ForEach(v => o.StuffList.Add(v.Clone() as IStuff)); ExpressList.ForEach(v => o.ExpressList.Add(v.Clone() as IExpress)); NoteList.ForEach(v => o.NoteList.Add(v.Clone() as INote)); EventList.ForEach(v => o.EventList.Add(v.Clone() as IEvent)); RelationList.ForEach(v => o.RelationList.Add(v.Clone() as IRelation)); TaskList.ForEach(v => o.TaskList.Add(v.Clone() as ITask)); GroupList.ForEach(v => o.GroupList.Add(v.Clone() as IGroup)); StructureDiagramList.ForEach(v => o.StructureDiagramList.Add(v.Clone() as IStructureDiagram)); return(o); }
//获得演员,信息照片都获取 public void GetActorList() { TextType = "演员"; Statistic(); stopwatch.Restart(); List <Actress> Actresses = DataBase.SelectAllActorName(VedioType); stopwatch.Stop(); Console.WriteLine($"\n加载演员用时:{stopwatch.ElapsedMilliseconds} ms"); if (ActorList != null && Actresses != null && Actresses.Count == ActorList.ToList().Count) { return; } ActorList = new ObservableCollection <Actress>(); ActorList.AddRange(Actresses); ActorFlipOver(); }
public async Task <ActionResult <ActorList> > PostActorList(ActorList actorList) { _context.ActorList.Add(actorList); try { await _context.SaveChangesAsync(); } catch (DbUpdateException) { if (ActorListExists(actorList.ActorId)) { return(Conflict()); } else { throw; } } return(CreatedAtAction("GetActorList", new { id = actorList.ActorId }, actorList)); }
public void RemoveEntity(IStoryEntityObject obj) { if (obj == null) { return; } if ((obj as IActor) != null) { ActorList.Remove(obj as IActor); return; } if ((obj as IEvent) != null) { EventList.Remove(obj as IEvent); return; } if ((obj as IStuff) != null) { StuffList.Remove(obj as IStuff); return; } if ((obj as IGroup) != null) { GroupList.Remove(obj as IGroup); return; } if ((obj as ITask) != null) { TaskList.Remove(obj as ITask); return; } if ((obj as ILocation) != null) { LocationList.Remove(obj as ILocation); return; } }
public DefaultScreen(Game game) : base(string.Empty, 0) { this.game = game; particleManager = new SquareParticleManager(); Add(particleManager); const int shift = margin; // Actors actorList = new ActorList(game, new MPos(512, 11 * 512), new MPos(512, 512), "wooden") { Position = new CPos(Left + 512 + margin, 768 + shift, 0) }; Add(actorList); // Spells spellList = new SpellList(game, new MPos(512, 13 * 512), new MPos(512, 512), "stone") { Position = new CPos(Right - 512 - margin, 0, 0) }; Add(spellList); manaBar = new DisplayBar(new MPos(Width / 2 - 1536, 256), PanelCache.Types["stone"], new Color(0, 0, 255, 196)) { Position = new CPos(0, Bottom - 2048 + margin, 0) }; Add(manaBar); healthBar = new DisplayBar(new MPos(Width / 2 - 256, 512), PanelCache.Types["wooden"], new Color(255, 0, 0, 196)) { Position = new CPos(0, Bottom - 1024 + margin, 0) }; Add(healthBar); var top = Top + 512 + margin; Add(new MoneyDisplay(game) { Position = new CPos(Left + 1536 + shift, top, 0) }); Add(new HealthDisplay(game) { Position = new CPos(Left + 4096 + shift + margin, top, 0) }); if (game.ObjectiveType == ObjectiveType.FIND_EXIT) { Add(new KeyDisplay(game) { Position = new CPos(Left + 712 + shift, top + 1536 + shift + 128, 0) }); } else if (game.ObjectiveType == ObjectiveType.SURVIVE_WAVES) { Add(new WaveDisplay(game) { Position = new CPos(Left + 512 + shift, top + 1536 + shift + 128, 0) }); } var menu = new CheckBox("menu", onTicked: (t) => game.ShowScreen(ScreenType.MENU, true)) { Position = new CPos(Right - 512 - margin, Top + 512 + margin, 0), Scale = 2.5f }; Add(menu); // mission text var missionText = new UITextLine(FontManager.Header, TextOffset.MIDDLE) { Position = new CPos(0, top, 0) }; var missionContent = string.Empty; switch (game.ObjectiveType) { case ObjectiveType.FIND_EXIT: missionContent = "Search for the exit and gain access to it!"; break; case ObjectiveType.KILL_ENEMIES: missionContent = "Wipe out all enemies on the map!"; break; case ObjectiveType.SURVIVE_WAVES: missionContent = "Defend your position from incoming waves!"; break; } missionText.SetText(missionContent); if (game.Save.Level == game.Save.FinalLevel) { missionText.SetColor(Color.Blue); } else if (game.Save.Level > game.Save.FinalLevel) { missionText.SetColor(Color.Green); } Add(missionText); Add(new EnemyPointer(game)); }
protected void AddPartyToActorListNew() { foreach (PartyMember activePartyMember in SingletonBehavior <PartyManager> .Instance.GetActivePartyMembers()) { int absoluteFormationIndex = SingletonBehavior <PartyManager> .Instance.GetAbsoluteFormationIndex(activePartyMember); if (absoluteFormationIndex >= 5) { Debug.Log($"AddPartyToActorList: {activePartyMember.name} {absoluteFormationIndex}"); } if (!(activePartyMember == null)) { if (activePartyMember.IsSecondaryPartyMember()) { if (AnimalCompanionsFollowOwner && activePartyMember.PartyMemberData.MemberType == PartyMemberType.AnimalCompanion) { AIBehavior behavior = AIBehaviorManager.AllocateFollowBehavior(); activePartyMember.AIController.BehaviorStack.PushBehavior(behavior); } } else { var gameObject = activePartyMember.gameObject; if (!activePartyMember.IsPrimaryPartyMember()) { activePartyMember.AIController.IgnoreAsCutsceneObstacle = true; } if (ActiveShot.UsePartyStartLocation && ActiveShot.PartyStartLocation != null) { if (ActiveShot.PartyStartLocation.Waypoints.Length - 1 < absoluteFormationIndex) { Array.Resize(ref ActiveShot.PartyStartLocation.Waypoints, absoluteFormationIndex + 1); } if (ActiveShot.PartyStartLocation.Waypoints[absoluteFormationIndex] == null) { ActiveShot.PartyStartLocation.Waypoints[absoluteFormationIndex] = new GameObject(); var neighbor = ActiveShot.PartyStartLocation.Waypoints[absoluteFormationIndex - 1] ?? ActiveShot.PartyStartLocation.Waypoints[0]; var position = neighbor.transform.position + Vector3.right; var rotation = neighbor.transform.rotation; ActiveShot.PartyStartLocation.Waypoints[absoluteFormationIndex].transform.SetPositionAndRotation(position, rotation); } var cutsceneWaypoint = new CutsceneWaypoint(); cutsceneWaypoint.owner = gameObject; cutsceneWaypoint.MoveType = MovementType.Teleport; cutsceneWaypoint.TeleportVFX = null; cutsceneWaypoint.Location = ActiveShot.PartyStartLocation.Waypoints[absoluteFormationIndex].transform; SpawnWaypointList.Add(cutsceneWaypoint); } if (ActiveShot.UsePartyMoveLocation && ActiveShot.PartyMoveLocation != null) { if (ActiveShot.PartyMoveLocation.Waypoints.Length - 1 < absoluteFormationIndex) { Array.Resize(ref ActiveShot.PartyMoveLocation.Waypoints, absoluteFormationIndex + 1); } if (ActiveShot.PartyMoveLocation.Waypoints[absoluteFormationIndex] == null) { ActiveShot.PartyMoveLocation.Waypoints[absoluteFormationIndex] = new GameObject(); var neighbor = ActiveShot.PartyMoveLocation.Waypoints[absoluteFormationIndex - 1] ?? ActiveShot.PartyMoveLocation.Waypoints[0]; var position = neighbor.transform.position + Vector3.right; var rotation = neighbor.transform.rotation; ActiveShot.PartyMoveLocation.Waypoints[absoluteFormationIndex].transform.SetPositionAndRotation(position, rotation); } var cutsceneWaypoint = new CutsceneWaypoint(); cutsceneWaypoint.owner = gameObject; cutsceneWaypoint.MoveType = MovementType.Teleport; cutsceneWaypoint.TeleportVFX = null; cutsceneWaypoint.Location = ActiveShot.PartyMoveLocation.Waypoints[absoluteFormationIndex].transform; SpawnWaypointList.Add(cutsceneWaypoint); } if (!ActorList.Contains(gameObject)) { ActorList.Add(gameObject); } } } } }