示例#1
0
 // Handle viewport sync
 private void Player_Moved(object sender, ItemMovedEventArgs <GoRogue.GameFramework.IGameObject> e)
 {
     if (CurrentMap == TestGame.CurrentMap)
     {
         TestGame.MapConsole.CenterViewPortOnPoint(Position);
     }
 }
示例#2
0
 private void BaseMapOnObjectMoved(object?sender, ItemMovedEventArgs <IGameObject> e)
 {
     if (!e.Item.IsWalkable || _goalMaps.ContainsKey(e.Item))
     {
         _dirty = true;
     }
 }
示例#3
0
    private void OnPlayerMoved(object sender, ItemMovedEventArgs <IGameObject> e)
    {
        var player = e.Item as Player;

        Map.CalculateFOV(e.NewPosition, player.FOVRadius, Radius.DIAMOND);
        Draw();
    }
 private void ListControl_OnItemMovedHandler(object sender, ItemMovedEventArgs args)
 {
     if (OnItemMoved != null)
     {
         OnItemMoved(args.OldItemIndex, args.NewItemIndex, list);
     }
 }
示例#5
0
        private void Player_Moved(object sender, ItemMovedEventArgs <IGameObject> e)
        {
            Map.CalculateFOV(Map.ControlledGameObject.Position, Map.ControlledGameObject.FOVRadius, Radius.SQUARE);
            MapRenderer.CenterViewPortOnPoint(Map.ControlledGameObject.Position);

            // TODO: Start using GameFrameManager instead
            TickWorld();
        }
示例#6
0
 /// <summary>
 /// Raises the ItemRemoved event.
 /// </summary>
 /// <param name="e">Event arguments</param>
 private void OnItemRemoved(ItemMovedEventArgs e)
 {
     try
     {
         _itemRemoved(this, e);
     }
     catch {}
 }
        // Handle the case where GoRogue's Position property was the one that initiated the move
        private void GoRogue_Moved(object sender, ItemMovedEventArgs <IGameObject> e)
        {
            if (Position != base.Position) // We need to sync entity
            {
                base.Position = Position;
            }

            // SadConsole's Entity position set can't fail so no need to check for success here
        }
示例#8
0
 private void TypeContextBase_ItemMoved(object sender, ItemMovedEventArgs <_I> e)
 {
     foreach (var item in this.GetTables())
     {
         var tableInfo = item.TableInfo;
         this.MoveType(ref tableInfo, e.OldPath, e.Item.Path);
         item.TableInfo = tableInfo;
     }
 }
示例#9
0
 private void OnObjectMoved(object sender, ItemMovedEventArgs <IGameObject> e)
 {
     // if (!(e.Item is Character character)) return;
     //
     // var fromPos = MapToWorld(new Vector2(e.OldPosition.X, e.OldPosition.Y));
     // var toPos = MapToWorld(new Vector2(e.NewPosition.X, e.NewPosition.Y));
     // character.TweenToPosition(fromPos, toPos);
     // character.PlayMovementSound();
 }
示例#10
0
 public void OnItemMoved(ItemMovedEventArgs eventArgs)
 {
     if (eventArgs.prevSlot >= 0)
     {
         inv.RemoveItem(eventArgs.prevSlot);
     }
     if (eventArgs.newSlot >= 0)
     {
         inv.SetItem((int)eventArgs.newSlot, eventArgs.item);
     }
 }
示例#11
0
 private static void OnPlayerMove(object sender, ItemMovedEventArgs <IGameObject> e)
 {
     Game.Animations.Add(
         sender.GetHashCode(),
         new FlashAnimation(
             new Coord[1] {
         e.OldPosition
     },
             Color.White,
             TimeSpan.FromMilliseconds(600),
             delay: TimeSpan.FromMilliseconds(100)));
 }
示例#12
0
        private void ItemMovedNotification(object sender, ItemMovedEventArgs args)
        {
            Assert.ArgumentNotNull(sender, "sender");
            Assert.ArgumentNotNull(args, "args");
            this.AddUpdatedItem(args.Item, true);
            Item item = args.Item.Database.GetItem(args.OldParentID);

            if (item != null)
            {
                this.AddUpdatedItem(item, false);
            }
        }
示例#13
0
        // Only entities (not terrain) can move so this is ok to just assume entities.
        private void Map_ObjectMoved(object sender, ItemMovedEventArgs <IGameObject> e)
        {
            if (!Enabled)
            {
                return;
            }

            if (Map.FOV.BooleanFOV[e.NewPosition])
            {
                UpdateEntitySeen((BasicEntity)(e.Item));
            }
            else
            {
                UpdateEntityUnseen((BasicEntity)(e.Item));
            }
        }
示例#14
0
        static void PstSplit_OnItemMoved(object sender, ItemMovedEventArgs e)
        {
            if (currentFolder == null)
            {
                currentFolder = e.DestinationFolder.RetrieveFullPath();
            }

            string folderPath = e.DestinationFolder.RetrieveFullPath();

            if (currentFolder != folderPath)
            {
                Console.WriteLine("    Added {0} messages to \"{1}\"", messageCount, currentFolder);
                messageCount = 0;
                currentFolder = folderPath;
            }

            messageCount++;
        }
示例#15
0
        static void PstSplit_OnItemMoved(object sender, ItemMovedEventArgs e)
        {
            if (currentFolder == null)
            {
                currentFolder = e.DestinationFolder.RetrieveFullPath();
            }

            string folderPath = e.DestinationFolder.RetrieveFullPath();

            if (currentFolder != folderPath)
            {
                Console.WriteLine("    Added {0} messages to \"{1}\"", messageCount, currentFolder);
                messageCount  = 0;
                currentFolder = folderPath;
            }

            messageCount++;
        }
        void Player_Moved(object sender, ItemMovedEventArgs <IGameObject> e)
        {
            Map.CalculateFOV(Player.Position, Game.Settings.FovDistance, Game.Settings.FovRadius);
            List <string> output = new List <string>();
            string        coords = "At " + Player.Position.X + ", " + Player.Position.Y + ";";

            output.Add(coords);
            string answer = "";


            foreach (Area area in Map.GetRegions(Player.Position))
            {
                answer += area + ", ";
            }
            output.Add(answer);
            Thoughts.Component.Think(output.ToArray());
            Health.Print();
            Display.CenterViewPortOnPoint(Map.ControlledGameObject.Position);
        }
示例#17
0
        private void MapOnObjectMoved(object?sender, ItemMovedEventArgs <IGameObject> e)
        {
            Direction direction = Direction.GetDirection(e.OldPosition, e.NewPosition);

            foreach (IGameObject gameObject in Map.GetObjects(e.OldPosition))
            {
                if (gameObject.GetComponent <TriggerComponent>() is TriggerComponent triggerComponent)
                {
                    triggerComponent.Exit(e.Item, direction);
                }
            }

            foreach (IGameObject gameObject in Map.GetObjects(e.NewPosition))
            {
                if (gameObject.GetComponent <TriggerComponent>() is TriggerComponent triggerComponent)
                {
                    triggerComponent.Enter(e.Item, direction);
                }
            }
        }
        static void PstMerge_OnItemMoved(object sender, ItemMovedEventArgs e)
        {
            // ExStart:MergePSTFiles-PstMerge_OnItemMoved
            if (currentFolder == null)
            {
                currentFolder = e.DestinationFolder.RetrieveFullPath();
            }

            string folderPath = e.DestinationFolder.RetrieveFullPath();

            if (currentFolder != folderPath)
            {
                Console.WriteLine("    Added {0} messages to \"{1}\"", messageCount, currentFolder);
                messageCount = 0;
                currentFolder = folderPath;
            }

            messageCount++;
            totalAdded++;
            // ExEnd:MergePSTFiles-PstMerge_OnItemMoved
        }
示例#19
0
        static void PstMerge_OnItemMoved(object sender, ItemMovedEventArgs e)
        {
            // ExStart:MergePSTFiles-PstMerge_OnItemMoved
            if (currentFolder == null)
            {
                currentFolder = e.DestinationFolder.RetrieveFullPath();
            }

            string folderPath = e.DestinationFolder.RetrieveFullPath();

            if (currentFolder != folderPath)
            {
                Console.WriteLine("    Added {0} messages to \"{1}\"", messageCount, currentFolder);
                messageCount  = 0;
                currentFolder = folderPath;
            }

            messageCount++;
            totalAdded++;
            // ExEnd:MergePSTFiles-PstMerge_OnItemMoved
        }
        private bool timeLineView_ItemMoved(object sender, ItemMovedEventArgs e)
        {
            TSequence fromSequence = animation.sequenceAtIndex(e.FromRowIndex);
            TSequence toSequence   = animation.sequenceAtIndex(e.ToRowIndex);
            TAction   action       = animation.actionAtIndex(e.FromRowIndex, e.FromItemIndex);

            if (fromSequence != null && toSequence != null && action != null)
            {
                toSequence.insertAction(e.ToItemIndex, action);
                if (e.FromRowIndex == e.ToRowIndex && e.ToItemIndex < e.FromItemIndex)
                {
                    fromSequence.deleteAction(e.FromItemIndex + 1);
                }
                else
                {
                    fromSequence.deleteAction(e.FromItemIndex);
                }
                return(true);
            }

            return(false);
        }
示例#21
0
        private void KanBan_ItemMoved(object sender, ItemMovedEventArgs e)
        {
            var item = (ContractSalesItem)e.Source;

            UpdateRestServerContractSalesItem(item);
        }
示例#22
0
 private void OnItemMoved(object?s, ItemMovedEventArgs <MyIDImpl> e)
 {
     Assert.Equal(_oldPos, e.OldPosition);
     Assert.Equal(_newPos, e.NewPosition);
 }
示例#23
0
 private void onItemMoved(object s, ItemMovedEventArgs <MyIDImpl> e)
 {
     Assert.AreEqual(oldPos, e.OldPosition);
     Assert.AreEqual(newPos, e.NewPosition);
 }
示例#24
0
 private void ItemMovedNotification(object sender, ItemMovedEventArgs args)
 {
     Assert.ArgumentNotNull(sender, "sender");
     Assert.ArgumentNotNull(args, "args");
     this.AddUpdatedItem(args.Item, true);
     Item item = args.Item.Database.GetItem(args.OldParentID);
     if (item != null)
     {
         this.AddUpdatedItem(item, false);
     }
 }
 private void ItemMovedNotification(object sender, ItemMovedEventArgs args)
 {
     Assert.ArgumentNotNull(sender, "sender");
     Assert.ArgumentNotNull(args, "args");
     if ((WebUtil.GetQueryString("mo") == "preview") && (args.Item.ID.ToString() == WebUtil.GetQueryString("fo")))
     {
         UrlOptions defaultOptions = UrlOptions.DefaultOptions;
         defaultOptions.ShortenUrls = false;
         SheerResponse.SetAttribute("scPostAction", "value", "goto:" + LinkManager.GetItemUrl(args.Item, defaultOptions));
     }
     Item folder = this.ContentEditorDataContext.GetFolder();
     if (Settings.ContentEditor.ClassicFrameEventPropagation || ((folder != null) && (((folder.ID == args.Item.ID) || (folder.ID == args.OldParentID)) || (folder.ID == args.Item.ParentID))))
     {
         string str = string.Concat(new object[] { "notification:itemmoved(item=", GetUri(args.Item), ",oldparentid=", args.OldParentID, ")" });
         Context.ClientPage.ClientResponse.Eval("scContent.postMessage(\"" + str + "\")");
     }
 }
示例#26
0
 private void Mobile_Moved(object sender, ItemMovedEventArgs <IGameObject> e)
 {
     DrawEntity.Position = e.NewPosition;
 }
示例#27
0
    /* UNUSED FOR NOW, BUT DO NOT DELETE.
     * void UpdateRelativePositions(object sender, SceneSwitchEventArgs e) {
     *      // Extremely hacky (ONCE SCENES ARE ALIGNED, THIS WON'T BE NECESSARY)
     *      Transform spaceConversionObj = GameObject.Find ("PastPresentDistance").transform;
     *      Transform child1 = spaceConversionObj.GetChild (0);
     *      if (child1.name.ToLower ().Contains ("past"))
     *              pastToPresent = -child1.position + spaceConversionObj.GetChild (1).position;
     *      else
     *              pastToPresent = -spaceConversionObj.GetChild (1).position + child1.position;
     * }
     */

    /// <summary>Event handler for the itemMoved event provided by ItemController.</summary>
    /// <param name="source">Originator of itemMoved event.</param>
    /// <param name="eventArgs">Useful context of the itemMoved event.</param>
    public void OnItemMoved(object source, ItemMovedEventArgs eventArgs)
    {
        activeCharacter.OnItemMoved(eventArgs);
    }
示例#28
0
 private void OnEnemyActed(object sender, ItemMovedEventArgs <IGameObject> e)
 {
 }
 void destinationFolder_ItemMoved(object sender, ItemMovedEventArgs e)
 {
     totalAdded++;
 }
		/// <summary>
		/// Raises the ItemAdded event.
		/// </summary>
		/// <param name="e">Event arguments</param>
		private void OnItemAdded(ItemMovedEventArgs e)
		{
			try
			{
				_itemAdded(this, e);
			}
			catch {}
		}
示例#31
0
 protected virtual void OnMoved(object sender, ItemMovedEventArgs <IGameObject> e)
 {
     gameObject.transform.DOMove(new Vector3(e.NewPosition.X, e.NewPosition.Y, 0), 0.15f);
 }
示例#32
0
 private void OnPlayerMove(object sender, ItemMovedEventArgs <IGameObject> e)
 {
     // Engine.E.Map.CalculateFOV(Position, Awareness);
     CurrentMap.CalculateFOV(Position, Stats[StatTypes.AWARENESS]);
 }
示例#33
0
 private void Player_Moved(object sender, ItemMovedEventArgs <IGameObject> e)
 {
     Map.CalculateFOV(Map.ControlledGameObject.Position, Map.ControlledGameObject.FOVRadius, Radius.SQUARE);
     MapRenderer.CenterViewPortOnPoint(Map.ControlledGameObject.Position);
 }
示例#34
0
 private void GameObjectManager_ItemMoved(object sender, ItemMovedEventArgs <GameObjects.GameObjectBase> e)
 {
     e.Item.Position = e.NewPosition.ToPoint();
     e.Item.MoveTo(e.NewPosition.ToPoint());
     e.Item.IsVisible = map.Surface.ViewPort.Contains(e.Item.Position);
 }
 void destinationFolder_ItemMoved(object sender, ItemMovedEventArgs e)
 {
     totalAdded++;
 }