public void SetSandwhichType(SandwhichType p_newSandwhichType) { m_hasBottomBread = p_newSandwhichType.m_hasBottomBread; m_hasTopBread = p_newSandwhichType.m_hasTopBread; m_hasMeat = p_newSandwhichType.m_hasMeat; m_hasVegies = p_newSandwhichType.m_hasVegies; m_hasSauce = p_newSandwhichType.m_hasSauce; }
/// <summary> /// Adds all the objects from the sandwich to this plate. Also sets the booleans for the ingredients that are in the sandwich /// </summary> /// <param name="p_newSandwhich"></param> /// <param name="p_currentSandwhichType"></param> /// <returns></returns> public GameObject CreatePlate(List <Transform> p_newSandwhich, SandwhichType p_currentSandwhichType) { m_currentSandwhichType.SetSandwhichType(p_currentSandwhichType); foreach (Transform sandwich in p_newSandwhich) { m_sandwhichObjects.Add(sandwich); sandwich.transform.parent = transform; } return(gameObject); }
public bool InteractionValid() { if (m_canTakeSandwich) { m_finalSandwhich = m_playerHand.CurrentHeldObject().ReturnCurrentObject().GetComponent <HoldablePlate>(); m_currentSandwich = m_finalSandwhich.GetComponent <HoldablePlate>().m_currentSandwhichType; m_playerHand.EmptyHand(true, false); StartTakenSandwichAnim(); m_sandwichHandedIn.Invoke(); } return(true); }
public bool MatchesSandwich(SandwhichType p_matchSandwich, out int p_errorType) { p_errorType = 0; if (!m_hasBottomBread) { return(false); } if (!m_hasTopBread) { p_errorType = 1; return(false); } if (p_matchSandwich.m_noSpecific) { return(true); } if (p_matchSandwich.m_hasMeat) { if (!m_hasMeat) { p_errorType = 2; return(false); } } if (p_matchSandwich.m_hasSauce) { if (!m_hasSauce) { p_errorType = 2; return(false); } } if (p_matchSandwich.m_hasVegies) { if (!m_hasVegies) { p_errorType = 2; return(false); } } return(true); }
public bool IsCorrectSandwich(SandwhichType p_checkSandwich, out int p_errorType) { return(p_checkSandwich.MatchesSandwich(m_currentSandwhichType, out p_errorType)); }