private void CheckTheAffectedBoxesForChaining(int boxID) { if (levelCreator.GetListOfBoxes()[boxID].GetScore() == 4) { RemoveBoxFromChain(boxID); } else if (levelCreator.GetListOfBoxes()[boxID].GetScore() >= 2) { CalculateChainAroundPivotBox(boxID); } }
//this should only be called once when this AI is initialized private void GatherAndGenerateRequiredData() { listOfBoxesOfScoreLessThan2.Clear(); List <Box> boxesList = m_levelCreator.GetListOfBoxes(); foreach (Box item in boxesList) { if (item.GetScore() < 2) { listOfBoxesOfScoreLessThan2.Add(item.GetBoxID()); } } Dictionary <int, GameStructs.NodeData> nodeData = m_levelCreator.GetLevelNodeData(); foreach (var item in listOfBoxesOfScoreLessThan2) { relevantNodeData.Add(item, nodeData[item]); } }