Example #1
0
    private void SetElements(CompleteCaseEvaluation caseEvaluation)
    {
        CaseField.DestroyAllChildren();

        CaseDescription   caseDescription = caseEvaluation.RoleplayDescription.Case;
        ModuleCaseProfile profile         = ProfileContainer.GetCaseProfileOfModule(caseDescription.Module);

        int[][] characteristics = caseDescription.Characteristics;

        for (int i = 0; i < characteristics.Length; i++)
        {
            CaseElement       element           = profile.GetElement(i);
            VisualCaseElement visualCaseElement = Instantiate(ElementObject, CaseField);
            visualCaseElement.SetName(element.Name);
            int[] elementIndices = characteristics[i];

            for (int j = 0; j < elementIndices.Length; j++)
            {
                int    k = elementIndices[j];
                string characteristic = element.OptionPool[k];

                visualCaseElement.AddCharacteristic(characteristic);
            }
        }
    }
        public static CaseElement Case(this SwitchElement me, string label, string when)
        {
            var c = new CaseElement {
                Label = label, When = when
            };

            me?.Cases.Add(c);
            return(c);
        }
    private void PrepareBriefingScreens(RoleplayDescription roleplay)
    {
        ModuleCaseProfile profile = ProfileContainer.GetCaseProfileOfModule(roleplay.Case.Module);

        UserBCaseField.DestroyAllChildren();
        UserACaseField.DestroyAllChildren();

        ClientName.text       = roleplay.UserB.Name;
        ProfessionalName.text = roleplay.UserA.Name;

        for (int i = 0; i < roleplay.Case.Characteristics.Length; i++)
        {
            int[] characteristics = roleplay.Case.Characteristics[i];

            CaseElement element = profile.Elements[i];

            VisualCaseElement visualCaseUserA = null;
            VisualCaseElement visualCaseUserB = null;

            if (element.VisibleUserA)
            {
                visualCaseUserA = Instantiate(ElementObject, UserACaseField);
                visualCaseUserA.SetName(element.Name);
            }

            if (element.VisibleUserB)
            {
                visualCaseUserB = Instantiate(ElementObject, UserBCaseField);
                visualCaseUserB.SetName(element.Name);
            }

            for (int j = 0; j < characteristics.Length; j++)
            {
                string option = element.OptionPool[j];

                if (element.VisibleUserA)
                {
                    visualCaseUserA.AddCharacteristic(option);
                }

                if (element.VisibleUserB)
                {
                    visualCaseUserB.AddCharacteristic(option);
                }
            }
        }
    }
    private CaseDescription GenerateCase(RoleplayModule module)
    {
        ModuleCaseProfile profile = ProfileContainer.GetCaseProfileOfModule(module);

        int[][] elementData = new int[profile.Elements.Length][];

        for (int i = 0; i < profile.Elements.Length; i++)
        {
            CaseElement element = profile.Elements[i];

            int   count = Mathf.Min(element.OptionCount, element.OptionPool.Length);
            int[] data  = elementData[i] = new int[count];

            for (int j = 0; j < count; j++)
            {
                int k = random.Next(element.OptionPool.Length);

                for (int l = 0; l < j; l++)
                {
                    int m = data[l];

                    if (m == j)
                    {
                        j--;
                        break;
                    }
                }

                data[j] = k;
            }
        }

        CaseDescription caseDescription = new CaseDescription(elementData, module);

        return(caseDescription);
    }
 public void Remove(CaseElement item)
 {
     this.InnerList.Remove(item);
 }
 public void Insert(int index, CaseElement item)
 {
     this.InnerList.Insert(index, item);
 }
 public int IndexOf(CaseElement item)
 {
     return this.InnerList.IndexOf(item);
 }
 public void CopyTo(CaseElement[] array, int index)
 {
     this.InnerList.CopyTo(array, index);
 }
 public bool Contains(CaseElement item)
 {
     return this.InnerList.Contains(item);
 }
 public void AddRange(CaseElement[] items)
 {
     this.InnerList.AddRange(items);
 }
 public int Add(CaseElement item)
 {
     return base.List.Add(item);
 }
 public CaseContainerCollection(CaseElement[] value)
 {
     this.InnerList.AddRange(value);
 }