コード例 #1
0
        public static String GetIngredient(ServerIngredientContainer container)
        {
            String  result = "";
            Boolean flag   = true;

            AssembledDefinitionNode[] containerContents = container.GetContents();
            ArrayList contents = new ArrayList();

            foreach (AssembledDefinitionNode node in containerContents)
            {
                ItemUtil.GetIngredientsInNode(node, contents);
            }
            foreach (String content in contents)
            {
                if (flag == true)
                {
                    result = result + content;
                    flag   = false;
                }
                else
                {
                    result = result + "+" + content;
                }
            }
            return(result);
        }
コード例 #2
0
        public static ArrayList GetIngredientContainerContents(GameObject gameObject)
        {
            ServerIngredientContainer serverIngredientContainer = gameObject.GetComponent <ServerIngredientContainer>();

            AssembledDefinitionNode[] plateContents = serverIngredientContainer.GetContents();

            //Logger.Log($"Plate contents size: {plateContents.Length}");

            ArrayList contents = new ArrayList();

            foreach (AssembledDefinitionNode node in plateContents)
            {
                ItemUtil.GetIngredientsInNode(node, contents);
            }

            return(contents);
        }
コード例 #3
0
ファイル: Main.cs プロジェクト: alina-gmc/Overcooked-cooker
        private ContainerInfo getContainerInfo(ServerIngredientContainer container)
        {
            ContainerInfo cInfo = new ContainerInfo();

            cInfo.name = container.name;
            cInfo.id   = container.gameObject.GetInstanceID().ToString();
            cInfo.p    = new ContainerInfo.Position();
            Vector3 cPos = getContainerPosition(container);

            cInfo.p.x           = Math.Round(cPos.x, 2);
            cInfo.p.y           = Math.Round(cPos.y, 2);
            cInfo.p.z           = Math.Round(cPos.z, 2);
            cInfo.hasIngredient = ContainerUtil.HasIngredient(container);
            if (cInfo.hasIngredient == false)
            {
                cInfo.ingredient = "None";
            }
            else
            {
                cInfo.ingredient = ContainerUtil.GetIngredient(container);
            }
            return(cInfo);
        }
コード例 #4
0
 public static Vector3 GetContainerPosition(ServerIngredientContainer container)
 {
     return(container.transform.position);
 }
コード例 #5
0
 public static bool HasIngredient(ServerIngredientContainer container)
 {
     return(GetIngredient(container) != "");
 }
コード例 #6
0
ファイル: Main.cs プロジェクト: alina-gmc/Overcooked-cooker
        private Vector3 getContainerPosition(ServerIngredientContainer container)
        {
            Vector3 containerPos = ContainerUtil.GetContainerPosition(container);

            return(containerPos);
        }