This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Fill out your copyright notice in the Description page of Project Settings. | |
#include "EnvQueryGenerator_GridOffset.h" | |
#include "AI/Navigation/NavigationTypes.h" | |
#include "EnvironmentQuery/Contexts/EnvQueryContext_Querier.h" | |
#define LOCTEXT_NAMESPACE "EnvQueryGenerator" | |
UEnvQueryGenerator_GridOffset::UEnvQueryGenerator_GridOffset() | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "MyAIController.h" | |
#include "EnvironmentQuery/EnvQueryManager.h" | |
void AMyAIController::FindHidingSpot() | |
{ | |
FEnvQueryRequest HidingSpotQueryRequest = FEnvQueryRequest(FindHidingSpotEQS, this); | |
HidingSpotQueryRequest.Execute(EEnvQueryRunMode::SingleResult, this, &AMyAIController::MoveToQueryResult); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "AIControllerTeam.h" | |
// A Tutorial for this code is available here: | |
// https://www.thinkandbuild.it/ue4-ai-perception-system/ | |
AAIControllerTeam::AAIControllerTeam() | |
{ | |
SetGenericTeamId(FGenericTeamId(5)); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//This code works correctly in the Application target, while in the Test target I get this warning: | |
//Cast from 'XCUIElement!' to unrelated type 'String' always fails. | |
//JSON is of type AnyObject? | |
let fieldErrors = JSON!["errors"] as? [String:String] | |
//I've already tried to convert this code in a more "swift 2" format using guard and removing the "optional"...nothing changes. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension NSBundle { | |
class var versionNumber: String { | |
if let version = NSBundle.mainBundle().infoDictionary?["CFBundleShortVersionString"] as? String { | |
return version | |
} | |
return "N.D." | |
} | |
class var buildNumber: String { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension Array { | |
func contains(object:AnyObject) -> Bool { | |
return self.bridgeToObjectiveC().containsObject(object) | |
} | |
func indexOf(object:AnyObject) -> Int { | |
return self.bridgeToObjectiveC().indexOfObject(object) | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Manager { | |
class var sharedManager : Manager { | |
struct Singleton { | |
static let instance : Manager = Manager() // let is Thread-safe | |
} | |
return Singleton.instance | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
class ViewController: UIViewController { | |
@IBOutlet var searchBar:UISearchBar | |
@IBOutlet var tableView:UITableView | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Cocoa | |
func quicksort<T: Comparable>(array:T[])->T[] { | |
var less = T[](), equal = T[](), greater = T[]() | |
if array.count > 1{ | |
let pivot = array[0] | |
for x in array{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Cocoa | |
func quicksort(array:Int[])->Int[] { | |
var less = Int[](), equal = Int[](), greater = Int[]() | |
if array.count > 1{ | |
let pivot = array[0] | |
for x in array{ |
NewerOlder