コード例 #1
0
ファイル: Entity.cs プロジェクト: neroes/AI-MAS
        //Check if this entity is in the given direction of the given other entity
        public bool isInDirection(Entity entity, Entity.Direction direction)
        {
            System.Drawing.Point point = getCoordinatesFromDirection(entity, direction);

            if (point.Y == this.y && point.X == this.x)
            {
                return(true);
            }

            return(false);
        }
コード例 #2
0
ファイル: MainViewModel.cs プロジェクト: neroes/AI-MAS
        public void ArrowKeyAction(Entity.Direction direction)
        {
            System.Drawing.Point point = Entity.getCoordinatesFromDirection(player, direction);

            //Add the action to the undo/redo stack and execute it
            if (map.isWalkable(point.X, point.Y))
            {
                undoRedoController.AddAndExecute(new ArrowKeyActionCommand(this, direction));
                Update();
            }
        }