MemeTexter/Assets/Scripts/MessageManager.cs
/// <summary>
/// Generate a new, random message from a given senderType for a given scenario
/// </summary>
/// <param name="mType">The type of message to return, AKA the scenario (conversation, battle, etc.)</param>
/// <param name="sType">The type of sender for this message (Mom, Dad, Rival, etc.)</param>
/// <returns>A random message with the given constraints</returns>
Generate a new, random message from a given senderType for a given scenario
Generate a new random message from a given senderType for a given scenario
public static Message GetMessage(MessageType mType, SenderType sType)
    {
        List<Message> tempList = new List<Message>();
        for (int i = 0; i < texts.Count; i++)
        {
            if (mType == texts[i].getMessageType() && sType == texts[i].getSenderType())
            {
                tempList.Add(texts[i]);
            }
        }
        int rand = UnityEngine.Random.Range(0, tempList.Count);
        return tempList[rand];
    }
public static Message GetMessage ( MessageType mType , SenderType sType ) { List < Message > tempList = new List < Message > ( ) ; for ( int i = 0 ; i < texts . Count ; i ++ ) { if ( mType == texts [ i ] . getMessageType ( ) && sType == texts [ i ] . getSenderType ( ) ) { tempList . Add ( texts [ i ] ) ; } } int rand = UnityEngine . Random . Range ( 0 , tempList . Count ) ; return tempList [ rand ] ; }
Generate a new, random message from a given senderType for a given scenario
Generate a new random message from a given senderType for a given scenario
//this is still kinda ugly //iterate through the whole list to get  //need to specify UnityEngine here because we are using the "System" library //grab a random entry and return it
A random message with the given constraints
A random message with the given constraints
mType
MessageType
The type of message to return, AKA the scenario (conversation, battle, etc.)
The type of message to return AKA the scenario ( conversation battle etc . )
sType
SenderType
The type of sender for this message (Mom, Dad, Rival, etc.)
The type of sender for this message ( Mom Dad Rival etc . )