private void LoadOrder(XmlElement p_xmlOrder, mg_ss_SpecialOrderData p_data) { foreach (XmlElement item in p_xmlOrder.ChildNodes.OfType <XmlElement>()) { p_data.Order.Add(mg_ss_ItemGeneratorData.CalculateItemType(item.Attributes["Tag"].Value)); } }
private void GenerateOrder() { m_currentOrder.CopyOrder(m_nextOrder); m_itemGenerator.HighlightItemTypes(m_currentOrder.GetItemTypes()); m_orderSystemObject.NewOrderReceived(); mg_ss_SpecialOrderData mg_ss_SpecialOrderData2 = CheckSpecialOrder(); int num = 0; string specialCustomer = m_currentOrder.SpecialCustomer; while (specialCustomer != null && mg_ss_SpecialOrderData2 != null && mg_ss_SpecialOrderData2.Tag == specialCustomer) { if (num == 10) { mg_ss_SpecialOrderData2 = null; break; } mg_ss_SpecialOrderData2 = CheckSpecialOrder(); num++; } if (mg_ss_SpecialOrderData2 == null) { GenerateNextGenericOrder(); } else { m_nextOrder.GenerateSpecialOrder(mg_ss_SpecialOrderData2); } }
public void GenerateSpecialOrder(mg_ss_SpecialOrderData p_orderData) { ClearOrder(); SpecialOrder = p_orderData; mg_ss_OrderStep mg_ss_OrderStep2 = null; for (int i = 0; i < SpecialOrder.Order.Count; i++) { mg_ss_OrderStep2 = Steps[i]; mg_ss_OrderStep2.FruitType = SpecialOrder.Order[i]; mg_ss_OrderStep2.State = mg_ss_EOrderStepState.INCOMPLETE; } }
public void Initialize(mg_ss_ItemGenerator_Normal p_itemGenerator, mg_ss_OrderSystemObject p_orderSystemObject) { m_itemGenerator = p_itemGenerator; m_orderSystemObject = p_orderSystemObject; mg_ss_Resources resources = MinigameManager.GetActive <mg_SmoothieSmash>().Resources; m_orderData = resources.OrderLengthData; m_specialOrderData = resources.SpecialOrderData; m_currentOrder = new mg_ss_Order(); m_nextOrder = new mg_ss_Order(); m_orderSystemObject.Initialize(m_currentOrder); GenerateNextGenericOrder(); GenerateOrder(); m_ordersCompleted = 0; }
private mg_ss_SpecialOrderData CheckSpecialOrder() { mg_ss_SpecialOrderData mg_ss_SpecialOrderData2 = null; if (m_orderData.SpecialAllowed) { int num = Random.Range(0, 101); mg_ss_SpecialOrderData2 = m_specialOrderData; while (mg_ss_SpecialOrderData2 != null && mg_ss_SpecialOrderData2.Percentage <= num) { num -= mg_ss_SpecialOrderData2.Percentage; mg_ss_SpecialOrderData2 = mg_ss_SpecialOrderData2.NextOrder; } } return(mg_ss_SpecialOrderData2); }
private void LoadGameResources_Normal() { LoadResource("SmoothieSmash/mg_ss_pf_GameNormal", mg_ss_EResourceList.GAME_SPECIFIC); LoadResource("SmoothieSmash/mg_ss_pf_GameSounds_Single_Normal", mg_ss_EResourceList.GAME_SPECIFIC_SOUNDS_SINGLE); LoadResource("SmoothieSmash/mg_ss_pf_clock", mg_ss_EResourceList.GAME_ITEM_CLOCK); LoadResource("SmoothieSmash/mg_ss_pf_aunt_arctic", mg_ss_EResourceList.GAME_AUNT_ARTIC); LoadResource("SmoothieSmash/mg_ss_pf_rock_hopper", mg_ss_EResourceList.GAME_ROCK_HOPPER); LoadResource("SmoothieSmash/mg_ss_pf_herbert", mg_ss_EResourceList.GAME_HERBERT); ConveyorSpeedData = new mg_ss_ConveyorSpeedData("SmoothieSmash/mg_ss_ConveyorSpeedData_Normal"); ItemGeneratorData = new mg_ss_ItemGeneratorData(); ItemGeneratorData.LoadXML("SmoothieSmash/mg_ss_ItemGeneratorData_Normal"); OrderLengthData = new mg_ss_OrderLengthData(); OrderLengthData.LoadXML("SmoothieSmash/mg_ss_OrderLengthData"); SpecialOrderData = new mg_ss_SpecialOrderData(); SpecialOrderData.LoadXML("SmoothieSmash/mg_ss_SpecialOrderData"); }
public void LoadXML(string p_xmlPath) { TextAsset textAsset = Resources.Load(p_xmlPath) as TextAsset; XmlDocument xmlDocument = new XmlDocument(); xmlDocument.LoadXml(textAsset.text); XmlNode xmlNode = xmlDocument.SelectSingleNode("/data"); mg_ss_SpecialOrderData mg_ss_SpecialOrderData2 = null; foreach (XmlElement item in xmlNode.ChildNodes.OfType <XmlElement>()) { if (mg_ss_SpecialOrderData2 == null) { mg_ss_SpecialOrderData2 = this; } else { mg_ss_SpecialOrderData2.NextOrder = new mg_ss_SpecialOrderData(); mg_ss_SpecialOrderData2 = mg_ss_SpecialOrderData2.NextOrder; } mg_ss_Resources.LoadXMLClass(mg_ss_SpecialOrderData2, item); LoadOrder(item, mg_ss_SpecialOrderData2); } }