C# Class Nez.AI.GOAP.Action

Datei anzeigen Open project: prime31/Nez Class Usage Examples

Public Properties

Property Type Description
cost int
name string

Public Methods

Method Description
Action ( ) : System
Action ( string name ) : System
Action ( string name, int cost ) : System
ToString ( ) : string
setPostcondition ( string conditionName, bool value ) : void
setPrecondition ( string conditionName, bool value ) : void
validate ( ) : bool

called before the Planner does its planning. Gives the Action an opportunity to set its score or to opt out if it isnt of use. For example, if the Action is to pick up a gun but there are no guns in the world returning false would keep the Action from being considered by the ActionPlanner.

Method Details

Action() public method

public Action ( ) : System
return System

Action() public method

public Action ( string name ) : System
name string
return System

Action() public method

public Action ( string name, int cost ) : System
name string
cost int
return System

ToString() public method

public ToString ( ) : string
return string

setPostcondition() public method

public setPostcondition ( string conditionName, bool value ) : void
conditionName string
value bool
return void

setPrecondition() public method

public setPrecondition ( string conditionName, bool value ) : void
conditionName string
value bool
return void

validate() public method

called before the Planner does its planning. Gives the Action an opportunity to set its score or to opt out if it isnt of use. For example, if the Action is to pick up a gun but there are no guns in the world returning false would keep the Action from being considered by the ActionPlanner.
public validate ( ) : bool
return bool

Property Details

cost public_oe property

The cost of performing the action. Figure out a weight that suits the action. Changing it will affect what actions are chosen during planning
public int cost
return int

name public_oe property

optional name for the Action. Used for debugging purposes
public string name
return string