SchemeIsActive: Difference between revisions

From Intrigues Wiki
(Created page with "== <code>SchemeIsActive</code> Method in Actor Class == === Overview === The <code>SchemeIsActive</code> method in the <code>Actor</code> class is designed to verify if a specific scheme is active based on provided conditions. This method is crucial in games where schemes, plots, or strategic actions play a significant role in the narrative, character interactions, or gameplay mechanics. === Syntax === <syntaxhighlight lang="c#"> public bool SchemeIsActive(string schem...")
 
No edit summary
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
== <code>SchemeIsActive</code> Method in Actor Class ==
== <code>SchemeIsActive</code> Methods in Actor Class ==


=== Overview ===
=== Method 1: Verify Scheme Based on Conditions ===
The <code>SchemeIsActive</code> method in the <code>Actor</code> class is designed to verify if a specific scheme is active based on provided conditions. This method is crucial in games where schemes, plots, or strategic actions play a significant role in the narrative, character interactions, or gameplay mechanics.


=== Syntax ===
==== Syntax ====
<syntaxhighlight lang="c#">
<syntaxhighlight lang="c#">
public bool SchemeIsActive(string schemeNameOrId, VerifyType type, Actor target = null)
public bool SchemeIsActive(string schemeNameOrId, VerifyType type, Actor target = null)
</syntaxhighlight>
</syntaxhighlight>


=== Parameters ===
==== Parameters ====


* <code>schemeNameOrId</code> (string): Name or ID of the scheme to check.
* <code>schemeNameOrId</code> (string): The identifier of the scheme.
* <code>type</code> (VerifyType): The type of verification to be performed.
* <code>type</code> (VerifyType): The type of verification (ToTarget, ToAnyone, FromAnyone).
* <code>target</code> (Actor): Optional. The actor target to check against, relevant only for <code>ToTarget</code> verification.
* <code>target</code> (Actor): Optional. The actor to check against (only for ToTarget).


=== Description ===
==== Functionality ====
Checks if a scheme is active based on specific conditions and verification types.


* Functionality: This method checks if a scheme, identified by its name or ID, is active based on the specified verification type. The <code>VerifyType</code> enum includes options to check if the scheme is active against a specific target (<code>ToTarget</code>), any target (<code>ToAnyone</code>), or if someone has activated the scheme against the current actor (<code>FromAnyone</code>).
=== Method 2: Check if Scheme is Active ===
* Purpose: The <code>SchemeIsActive</code> method is essential for determining the status of schemes within the game, affecting decisions, character actions, and narrative outcomes.


=== Usage ===
==== Syntax ====
This method is used to ascertain the activity status of a scheme, adjusting gameplay and narrative elements based on the existence and nature of such schemes.
<syntaxhighlight lang="c#">
public bool SchemeIsActive(string schemeNameOrId)
</syntaxhighlight>
 
==== Parameters ====
 
* <code>schemeNameOrId</code> (string): The identifier of the scheme.
 
==== Functionality ====
Verifies if the specified scheme is currently active, without targeting specifics.
 
=== Method 3: Verify Scheme Against a Target ===


==== Example of Usage: ====
==== Syntax ====
<syntaxhighlight lang="c#">
<syntaxhighlight lang="c#">
public Actor conspirator; // Assume conspirator is an initialized instance of an Actor
public bool SchemeIsActive(string schemeNameOrId, Actor target)
public Actor target; // Assume target is an initialized instance of an Actor
</syntaxhighlight>
string schemeId = "Assassination";


// Check if the 'Assassination' scheme is active against the target
==== Parameters ====
bool isSchemeActive = conspirator.SchemeIsActive(schemeId, VerifyType.ToTarget, target);


if (isSchemeActive) {
* <code>schemeNameOrId</code> (string): The identifier of the scheme.
    // Execute logic specific to the active scheme against the target
* <code>target</code> (Actor): The actor target to check against.
    // This could involve preparing defenses, countermeasures, or narrative developments
}


</syntaxhighlight>In this usage, it checks if an 'Assassination' scheme is active against a target.
==== Functionality ====
Checks if a scheme is specifically active against a given target actor.


=== Remarks ===
=== Common Usage ===
Used in strategy and role-playing games to determine the status of schemes for gameplay decisions and character interactions. Essential for tracking schemes in dynamic game environments.


* The <code>SchemeIsActive</code> method provides a dynamic way to interact with game scenarios involving schemes and strategic planning.
==== Example ====
* The method's flexibility, through the use of the <code>VerifyType</code> enum, allows for a nuanced approach to checking scheme statuses, accommodating various gameplay scenarios and storylines.
<syntaxhighlight lang="c#">
* This method is particularly important in strategy games, role-playing games, or narrative-driven games where schemes and plots significantly influence the game's progression and character dynamics.
public Actor conspirator;
public Actor target;
string schemeName = "Assassination";
 
// Example for Method 1
bool isSchemeActive = conspirator.SchemeIsActive(schemeName, VerifyType.ToTarget, target);
// Logic based on the scheme's activity status
</syntaxhighlight>

Latest revision as of 15:34, 23 December 2023

SchemeIsActive Methods in Actor Class

Method 1: Verify Scheme Based on Conditions

Syntax

public bool SchemeIsActive(string schemeNameOrId, VerifyType type, Actor target = null)

Parameters

  • schemeNameOrId (string): The identifier of the scheme.
  • type (VerifyType): The type of verification (ToTarget, ToAnyone, FromAnyone).
  • target (Actor): Optional. The actor to check against (only for ToTarget).

Functionality

Checks if a scheme is active based on specific conditions and verification types.

Method 2: Check if Scheme is Active

Syntax

public bool SchemeIsActive(string schemeNameOrId)

Parameters

  • schemeNameOrId (string): The identifier of the scheme.

Functionality

Verifies if the specified scheme is currently active, without targeting specifics.

Method 3: Verify Scheme Against a Target

Syntax

public bool SchemeIsActive(string schemeNameOrId, Actor target)

Parameters

  • schemeNameOrId (string): The identifier of the scheme.
  • target (Actor): The actor target to check against.

Functionality

Checks if a scheme is specifically active against a given target actor.

Common Usage

Used in strategy and role-playing games to determine the status of schemes for gameplay decisions and character interactions. Essential for tracking schemes in dynamic game environments.

Example

public Actor conspirator;
public Actor target;
string schemeName = "Assassination";

// Example for Method 1
bool isSchemeActive = conspirator.SchemeIsActive(schemeName, VerifyType.ToTarget, target);
// Logic based on the scheme's activity status