Show / Hide Table of Contents

Class Proposal

Class containing all the information for a single in-game proposal.

Inheritance
System.Object
UnityEngine.Object
UnityEngine.ScriptableObject
Proposal
Inherited Members
UnityEngine.ScriptableObject.SetDirty()
UnityEngine.ScriptableObject.CreateInstance(System.String)
UnityEngine.ScriptableObject.CreateInstance(System.Type)
UnityEngine.ScriptableObject.CreateInstance<T>()
UnityEngine.Object.GetInstanceID()
UnityEngine.Object.GetHashCode()
UnityEngine.Object.Equals(System.Object)
UnityEngine.Object.Instantiate(UnityEngine.Object, UnityEngine.Vector3, UnityEngine.Quaternion)
UnityEngine.Object.Instantiate(UnityEngine.Object, UnityEngine.Vector3, UnityEngine.Quaternion, UnityEngine.Transform)
UnityEngine.Object.Instantiate(UnityEngine.Object)
UnityEngine.Object.Instantiate(UnityEngine.Object, UnityEngine.Transform)
UnityEngine.Object.Instantiate(UnityEngine.Object, UnityEngine.Transform, System.Boolean)
UnityEngine.Object.Instantiate<T>(T)
UnityEngine.Object.Instantiate<T>(T, UnityEngine.Vector3, UnityEngine.Quaternion)
UnityEngine.Object.Instantiate<T>(T, UnityEngine.Vector3, UnityEngine.Quaternion, UnityEngine.Transform)
UnityEngine.Object.Instantiate<T>(T, UnityEngine.Transform)
UnityEngine.Object.Instantiate<T>(T, UnityEngine.Transform, System.Boolean)
UnityEngine.Object.Destroy(UnityEngine.Object, System.Single)
UnityEngine.Object.Destroy(UnityEngine.Object)
UnityEngine.Object.DestroyImmediate(UnityEngine.Object, System.Boolean)
UnityEngine.Object.DestroyImmediate(UnityEngine.Object)
UnityEngine.Object.FindObjectsOfType(System.Type)
UnityEngine.Object.FindObjectsOfType(System.Type, System.Boolean)
UnityEngine.Object.DontDestroyOnLoad(UnityEngine.Object)
UnityEngine.Object.DestroyObject(UnityEngine.Object, System.Single)
UnityEngine.Object.DestroyObject(UnityEngine.Object)
UnityEngine.Object.FindSceneObjectsOfType(System.Type)
UnityEngine.Object.FindObjectsOfTypeIncludingAssets(System.Type)
UnityEngine.Object.FindObjectsOfType<T>()
UnityEngine.Object.FindObjectsOfType<T>(System.Boolean)
UnityEngine.Object.FindObjectOfType<T>()
UnityEngine.Object.FindObjectOfType<T>(System.Boolean)
UnityEngine.Object.FindObjectsOfTypeAll(System.Type)
UnityEngine.Object.FindObjectOfType(System.Type)
UnityEngine.Object.FindObjectOfType(System.Type, System.Boolean)
UnityEngine.Object.ToString()
UnityEngine.Object.name
UnityEngine.Object.hideFlags
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: GDA
Assembly: Assembly-CSharp.dll
Syntax
[CreateAssetMenu(menuName = "ScriptableObjects/Proposal")]
public class Proposal : ScriptableObject

Fields

newsA

(Optional) News "generated" when the proposal is accepted.

Declaration
public NewsItem newsA
Field Value
Type Description
NewsItem

newsB

(Optional) News "generated" when the proposal is rejected.

Declaration
public NewsItem newsB
Field Value
Type Description
NewsItem

productA

The proposed product to accept/reject.

Declaration
public Product productA
Field Value
Type Description
Product

productB

The existing product to compare productBto.

Declaration
public Product productB
Field Value
Type Description
Product

proposer

The proposer that will be presenting the proposal.

Declaration
public ProposerInfo proposer
Field Value
Type Description
ProposerInfo

stateChangeA

(Optional) Predefined effects on the GameState when the proposal is accepted.

Declaration
public GameStateChange stateChangeA
Field Value
Type Description
GameStateChange

stateChangeB

(Optional) Predefined effects on the GameState when the proposal is rejected.

Declaration
public GameStateChange stateChangeB
Field Value
Type Description
GameStateChange

userGroup

The UserGroup associated with the proposal.

Declaration
public UserGroup userGroup
Field Value
Type Description
UserGroup

Properties

chosenProduct

The "chosen" product of the proposal. Returns productA if the proposal is accepted, and productB if the proposal is rejected. Returns null if proposal is undecided.

Declaration
public Product chosenProduct { get; }
Property Value
Type Description
Product

ChosenQty

The quantity of the chosenProduct needed to fulfill the needs of the userGroup. returns -1 if the proposal has not been decided on yet.

Declaration
public int ChosenQty { get; }
Property Value
Type Description
System.Int32

decision

The decision status of the proposal. Usually undecided (Nill) until player makes a decision.

Declaration
public Proposal.DecisionState decision { get; }
Property Value
Type Description
Proposal.DecisionState

newsArticle

The news "generated" by the decision of the proposal. Returns newsA if the proposal is accepted, and newsB if the proposal is rejected. Returns null if proposal is undecided. Note that: newsA and newsB may be null themselves.

Declaration
public NewsItem newsArticle { get; }
Property Value
Type Description
NewsItem

proposerBehaviour

The behevaiour that the proposer will exhibit.

Declaration
public TypeReference proposerBehaviour { get; }
Property Value
Type Description
TypeReferences.TypeReference

QtyA

The quantity of productA needed in order to fulfill the needs of the userGroup.

Declaration
public int QtyA { get; }
Property Value
Type Description
System.Int32

QtyB

The quantity of productB needed in order to fulfill the needs of the userGroup.

Declaration
public int QtyB { get; }
Property Value
Type Description
System.Int32

rejectedProduct

The "rejected" product of the proposal. Returns productB if the proposal is accepted, and productA if the proposal is rejected. Returns null if proposal is undecided.

Declaration
public Product rejectedProduct { get; }
Property Value
Type Description
Product

RejectedQty

The quantity of the rejectedProduct needed to fulfill the needs of the userGroup. returns -1 if the proposal has not been decided on yet.

Declaration
public int RejectedQty { get; }
Property Value
Type Description
System.Int32

scriptedConversations

Scripted Conversations specific to the proposal.

Declaration
public ReadOnlyDictionary<string, Conversation> scriptedConversations { get; }
Property Value
Type Description
System.Collections.ObjectModel.ReadOnlyDictionary<System.String, Conversation>

Methods

GenerateProposal(ProductGenerator, ProductGenerator, UserArchetype, UserArchetype.SizeMagnitude, ProposerInfo)

Generates a new proposal containing two products of different families of the same type. E.g. (surgical mask vs cloth mask)

Declaration
public static Proposal GenerateProposal(ProductGenerator productFamilyA, ProductGenerator productFamilyB, UserArchetype userArchetype, UserArchetype.SizeMagnitude sizeMagnitude, ProposerInfo proposer)
Parameters
Type Name Description
ProductGenerator productFamilyA

They type of product to be proposed

ProductGenerator productFamilyB

They type of product to be compared to (the existing product)

UserArchetype userArchetype

The type of usergroup to generate

UserArchetype.SizeMagnitude sizeMagnitude

The magnitude of the usergroup size

ProposerInfo proposer

The proposer presenting the proposal

Returns
Type Description
Proposal

GenerateProposal(ProductGenerator, UserArchetype, UserArchetype.SizeMagnitude, ProposerInfo)

Generates a new proposal containing two products of the same family and type.

Declaration
public static Proposal GenerateProposal(ProductGenerator productFamily, UserArchetype userArchetype, UserArchetype.SizeMagnitude sizeMagnitude, ProposerInfo proposer)
Parameters
Type Name Description
ProductGenerator productFamily

They type of product to generate

UserArchetype userArchetype

The type of user group to generate

UserArchetype.SizeMagnitude sizeMagnitude

The magnitude of the usergroup size

ProposerInfo proposer

The proposer presenting the proposal

Returns
Type Description
Proposal

GetCostOfApproval()

Calculates the funds required to approve the proposal.

Declaration
public float GetCostOfApproval()
Returns
Type Description
System.Single

GetCostOfOrder(Product)

Cost of single product in the proposal. Normally not used alone, but used to compare two products.

Declaration
public float GetCostOfOrder(Product product)
Parameters
Type Name Description
Product product
Returns
Type Description
System.Single

MakeDecision(Boolean)

Changes the decision status of the proposal to accepted/rejected.

Declaration
public void MakeDecision(bool chooseA)
Parameters
Type Name Description
System.Boolean chooseA

true for accepting, false for rejecting

ResetDecision()

Sets the decision status of the proposal back to Nill/undecided.

Declaration
public void ResetDecision()
In This Article
Back to top Generated by DocFX