인형의 기본 클래스
Inheritance: MonoBehaviour
Exemple #1
0
        public void SelectDoll(Doll doll)
        {
            DollSelectButton.Name = "Dolls/" + doll.Name;
            if (screen.Exists(DollSelectButton, 1000))
            {
                screen.Click(DollSelectButton);
                return;
            }
            var filterType = new Button("FormationPage/Filter" + doll.Type, new Rectangle(453, 305, 451, 147),
                                        new Button($"FormationPage/Filter{doll.Type}Clicked", new Rectangle(453, 305, 451, 147), null), .95f, FilterOptionArea);
            var filterRarity = new Button("FormationPage/Filter" + doll.Rarity, new Rectangle(453, 124, 456, 151),
                                          new Button($"FormationPage/Filter{doll.Rarity}Clicked", new Rectangle(453, 124, 456, 151), null), .95f, FilterOptionArea);

            screen.Click(FilterDollButton);
            if (screen.Exists(FilterActiveSample, 1000))
            {
                if (!(screen.Exists(filterType.Next, 0) && screen.Exists(filterRarity.Next)))
                {
                    screen.Click(FilterResetButton);
                    screen.Click(FilterDollButton);
                    screen.Click(filterRarity);
                    screen.Click(filterType);
                }
            }
            else
            {
                screen.Click(filterRarity);
                screen.Click(filterType);
            }
            screen.Click(FilterConfirmButton);
            screen.Click(DollSelectButton);
        }
Exemple #2
0
        public Doll EstimateSingleFrame(float w, float h, List <Keypoint> keypoints)
        {
            // Setup unknown variables' information
            var estimationDoll = new Doll();

            double[] unknowns;
            double[] lowerLimits;
            double[] upperLimits;
            InitializeInputArrays(estimationDoll, out unknowns, out lowerLimits, out upperLimits);
            double[] unknowns2 = new double[unknowns.Length];

            // Call Nelder-mead solver in Microsoft.Solver.Foundation librabry
            var solution = NelderMeadSolver.Solve(
                (input) =>
            {
                ReflectDecisionsToDoll(input, estimationDoll);
                estimationDoll.RenewAllPositions();
                return(estimationDoll.CalculateResidualSum(w, h, (float)input[0], keypoints));
            },
                unknowns, lowerLimits, upperLimits);

            Debug.WriteLine($"{solution.Result}");
            Debug.WriteLine($"Solution = {solution.GetSolutionValue(0)}");

            // Output
            return(estimationDoll);
        }
Exemple #3
0
        public void Produce(IEnumerable <Tile> level)
        {
            while (this.gifts.Count < Constants.MaxGifts)
            {
                int     randomGift  = this.Generator.Next(1, 6);
                Vector2 newPosition = ChoosePosition(level);

                Gift newGift = null;

                switch (randomGift)
                {
                case (int)GiftTypes.Doll:
                    newGift = new Doll(newPosition);
                    break;

                case (int)GiftTypes.Robot:
                    newGift = new Robot(newPosition);
                    break;

                case (int)GiftTypes.Drone:
                    newGift = new Drone(newPosition);
                    break;

                case (int)GiftTypes.Car:
                    newGift = new RealCar(newPosition);
                    break;

                case (int)GiftTypes.Plane:
                    newGift = new RealPlane(newPosition);
                    break;
                }

                this.gifts.Add(newGift);
            }
        }
Exemple #4
0
        public List <Doll> ChosenDollMove(Doll doll, List <Doll> dolls, string cardName)
        {
            var targetIndex = dolls.FindIndex(x => x.Id == doll.Id);

            switch (cardName)
            {
            case "UpThree":
                dolls.Insert(targetIndex - 3, doll);
                dolls.RemoveAt(targetIndex + 1);
                return(dolls);

            case "UpTwo":
                dolls.Insert(targetIndex - 2, doll);
                dolls.RemoveAt(targetIndex + 1);
                return(dolls);

            case "UpOne":
                dolls.Insert(targetIndex - 1, doll);
                dolls.RemoveAt(targetIndex + 1);
                return(dolls);

            case "DropDown":
                dolls.Add(doll);
                dolls.RemoveAt(targetIndex);
                return(dolls);

            default:
                return(null);
            }
        }
        public void RemoveTest()
        {
            Doll cloneDorothy = dorothy.Copy(); // Doll with several accessories.

            Dress    dorothyDress     = pinkPartyDress.Copy() as Dress;
            Purse    dorothyPurse     = premiumPurse.Copy() as Purse;
            Necklace dorothyNecklace  = diamondNecklace.Copy() as Necklace;
            Bracelet dorothyBraceletA = braidedBracelet.Copy() as Bracelet;
            Bracelet dorothyBraceletB = diamondBracelet.Copy() as Bracelet;
            Bracelet dorothyBraceletC = fantasyBraceletA.Copy() as Bracelet;
            Bracelet dorothyBraceletD = fantasyBraceletB.Copy() as Bracelet;

            cloneDorothy.Wear(dorothyDress);
            cloneDorothy.Wear(dorothyPurse);
            cloneDorothy.Wear(dorothyNecklace);
            cloneDorothy.Wear(dorothyBraceletA);
            cloneDorothy.Wear(dorothyBraceletB);
            cloneDorothy.Wear(dorothyBraceletC);
            cloneDorothy.Wear(dorothyBraceletD);

            // Removing a doll's dress will remove all accessories at once.
            cloneDorothy.Remove(dorothyDress);

            Assert.AreEqual(cloneDorothy.TotalAccessories, 0);
        }
Exemple #6
0
 void SpawnDoll()
 {
     currDoll = spawnMgr.SpawnOurForce(dollPrefab, line, transform.position) as Doll;
     currDoll.Init(this);
     dollSpawned = true;
     canSpawn = false;
 }
Exemple #7
0
        private void RadioButtonSpeaking_Checked(object sender, RoutedEventArgs e)
        {
            RadioButton radioButton = (RadioButton)sender;
            string      speaking    = radioButton.Content.ToString();

            if (buttonsChecked["speaking"])
            {
                if (valueChecked["speaking"] == "Yes")
                {
                    priceInt -= Doll.PriceSpeaking(true);
                }
                else
                {
                    priceInt -= Doll.PriceSpeaking(false);
                }
            }
            else
            {
                buttonsChecked["speaking"] = true;
            }
            valueChecked["speaking"] = speaking;
            if (speaking == "Yes")
            {
                priceInt += Doll.PriceSpeaking(true);
            }
            else
            {
                priceInt += Doll.PriceSpeaking(false);
            }
            price.Content = priceInt.ToString();
        }
Exemple #8
0
    public void AddContent(Doll doll)
    {
        var go = Instantiate(dollButtonPrefab, content.position, Quaternion.identity)
                 as GameObject;

        go.transform.SetParent(content, false);
        go.GetComponent <Button>().onClick.AddListener(() => SelectDoll(doll.id));
    }
Exemple #9
0
        public void ReplaceZas()
        {
            var dollOut = Doll.Get("Zas1");
            var dollIn  = Doll.Get("Zas2Leader");

            ReplaceDoll(dollOut, dollIn);
            AddDollToEchelon(dollOut, 2, 1);
        }
Exemple #10
0
    // call during initialization only
    public Doll AssignNextDoll(BattleUnit unit)
    {
        Doll doll = dolls[dollFillIndex];

        doll.Populate(unit);
        dollFillIndex += 1;
        return(doll);
    }
Exemple #11
0
 public void Spawn(Doll doll, int pos)
 {
     if (pos - 1 < 0)
     {
         return;
     }
     doll.Spawn(tiles[pos - 1].tr);
     tiles[pos - 1].doll = doll;
 }
        public void CanParticipateTest()
        {
            Doll cloneDorothy   = dorothy.Copy();   // Doll without accessories. Can't participate
            Doll cloneAnastasia = anastasia.Copy(); // Doll with a single dress. Can participate

            cloneAnastasia.Wear(blackOfficeSuit);

            Assert.AreEqual(cloneDorothy.CanParticipate, false);
            Assert.AreEqual(cloneAnastasia.CanParticipate, true);
        }
Exemple #13
0
        public void ReplaceCorpseDragger()
        {
            var dollOut = Doll.Get(Properties.Settings.Default.DollExhausted);
            var dollIn  = Doll.Get(Properties.Settings.Default.DollLoaded);

            ReplaceDoll(dollOut, dollIn);
            //AddDollToEchelon(dollOut, 2, 1);
            Properties.Settings.Default.DollExhausted = dollIn.Name;
            Properties.Settings.Default.DollLoaded    = dollOut.Name;
            Properties.Settings.Default.Save();
        }
Exemple #14
0
 public bool HasDollInCollision()
 {
     foreach (Collider2D entity in entitiesInCollision)
     {
         Doll dollComponent = entity.GetComponent <Doll>();
         if (dollComponent != null)
         {
             return(true);
         }
     }
     return(false);
 }
        protected override async void OnCreate(Bundle savedInstanceState)
        {
            try
            {
                base.OnCreate(savedInstanceState);

                if (ETC.useLightTheme)
                {
                    SetTheme(Resource.Style.GFS_Toolbar_Light);
                }

                // Create your application here
                SetContentView(Resource.Layout.DollDBImageViewer);

                string[] temp = Intent.GetStringExtra("Data").Split(';');

                modIndex   = int.Parse(temp[1]);
                doll       = new Doll(ETC.FindDataRow(ETC.dollList, "DicNumber", int.Parse(temp[0])));
                censorType = doll.HasCensored ? doll.CensorType : null;

                toolbar                   = FindViewById <AndroidX.AppCompat.Widget.Toolbar>(Resource.Id.DollDBImageViewerMainToolbar);
                loadingLayout             = FindViewById <RelativeLayout>(Resource.Id.DollDBImageViewerLoadingLayout);
                loadingIndicator          = FindViewById <AVLoadingIndicatorView>(Resource.Id.DollDBImageViewerLoadingIndicatorView);
                loadingText               = FindViewById <TextView>(Resource.Id.DollDBImageViewerLoadingIndicatorExplainText);
                dollImageView             = FindViewById <PhotoView>(Resource.Id.DollDBImageViewerImageView);
                snackbarLayout            = FindViewById <CoordinatorLayout>(Resource.Id.DollDBImageViewerSnackbarLayout);
                costumeList               = FindViewById <Spinner>(Resource.Id.DollDBImageViewerCostumeList);
                costumeList.ItemSelected += (sender, e) =>
                {
                    isDamage     = false;
                    costumeIndex = e.Position;
                    censorMenuItem.SetVisible(CheckCensorType());

                    _ = LoadImage(costumeIndex, false);
                };
                imageStatus = FindViewById <TextView>(Resource.Id.DollDBImageViewerImageStatus);

                SetSupportActionBar(toolbar);
                SupportActionBar.SetDisplayShowTitleEnabled(false);
                SupportActionBar.SetDisplayHomeAsUpEnabled(true);

                await InitializeProcess();

                LoadCostumeList();
                _ = LoadImage(0, false);
            }
            catch (Exception ex)
            {
                ETC.LogError(ex, this);
                Toast.MakeText(this, Resource.String.Activity_OnCreateError, ToastLength.Short).Show();
            }
        }
Exemple #16
0
    public static Monster CreateMonster(MonsterList monster, Game game, int level)
    {
        Monster newMonster = null;

        switch (monster)
        {
        case MonsterList.Bat:
            newMonster          = Bat.Create(level, game);
            newMonster.Behavior = new StandardMoveAndAttack();
            break;

        case MonsterList.Banshee:
            newMonster          = Banshee.Create(level, game);
            newMonster.Behavior = new TeleportAroundPlayer();
            break;

        case MonsterList.Demon:
            newMonster          = Demon.Create(level, game);
            newMonster.Behavior = new StandardMoveAndAttack();
            break;

        case MonsterList.Doll:
            newMonster          = Doll.Create(level, game);
            newMonster.Behavior = new DontLookAway();
            break;

        case MonsterList.Ghoul:
            newMonster          = Ghoul.Create(level, game);
            newMonster.Behavior = new StandardMoveAndAttack();
            break;

        case MonsterList.LivingArmor:
            newMonster          = LivingArmor.Create(level, game);
            newMonster.Behavior = new DontLookAway();
            break;

        case MonsterList.Spider:
            newMonster          = Spider.Create(level, game);
            newMonster.Behavior = new StandardMoveAndAttack();
            break;

        case MonsterList.Wraith:
            newMonster          = Wraith.Create(level, game);
            newMonster.Behavior = new TeleportAroundPlayer();
            break;
        }

        newMonster.Health = newMonster.Health + (level - 1);
        newMonster.Attack = newMonster.Attack + (level - 1);

        return(newMonster);
    }
Exemple #17
0
    /// <summary>
    /// 스크롤뷰 콘텐츠에 인형버튼 추가 및 버튼 이벤트 할당
    /// </summary>
    /// <param name="doll"></param>
    public void AddContent(Doll doll)
    {
        var go = Instantiate(dollButtonPrefab, content.position, Quaternion.identity)
                 as GameObject;

        go.transform.SetParent(content, false);
        go.GetComponent <Button>().onClick.AddListener(() => SelectDoll(doll.id));
        go.GetComponent <Image>().sprite = doll.profilePic;
        var ele = go.GetComponent <ListElement>();

        ele.doll = doll;
        elements.Add(ele);
    }
Exemple #18
0
 public void ReplaceDoll(Doll dollOut, Doll dollIn)
 {
     screen.Wait(FormationScene);
     if (dollOut.Name.StartsWith("Zas"))
     {
         DollFormationButton.Name = "Dolls/Zas";
     }
     else
     {
         DollFormationButton.Name = "Dolls/" + dollOut.Name;
     }
     screen.Click(DollFormationButton);
     SelectDoll(dollIn);
 }
        private static void Main(string[] args)
        {
            //System.Console.ReadLine();
            PageantJury ConcursoPrueba = new PageantJury();

            Doll      doll    = new Doll("2Pac");
            Accessory vestido = new Dress(15, Dress.EColor.Black, Dress.EDressCategory.Casual);

            doll.Wear(vestido);
            Accessory accesorio = new Necklace(20000);

            doll.Wear(accesorio);
            doll.Remove(vestido);
            ConcursoPrueba.AddContestant(doll);

            doll      = new Doll("Snoop Dog");
            accesorio = new Dress(10, Dress.EColor.White, Dress.EDressCategory.Suit);
            doll.Wear(accesorio);
            accesorio = new Necklace(60);
            doll.Wear(accesorio);
            accesorio = new Bracelet(160);
            doll.Wear(accesorio);
            ConcursoPrueba.AddContestant(doll);

            doll      = new Doll("Mexicano 777");
            accesorio = new Dress(25, Dress.EColor.Pink, Dress.EDressCategory.Party);
            doll.Wear(accesorio);
            ConcursoPrueba.AddContestant(doll);

            doll      = new Doll("El judio");
            accesorio = new Dress(5, Dress.EColor.Green, Dress.EDressCategory.Casual);
            doll.Wear(accesorio);
            accesorio = new Bracelet(700);
            doll.Wear(accesorio);
            ConcursoPrueba.AddContestant(doll);



            if (ConcursoPrueba.GetWinner() == null)
            {
                System.Console.WriteLine("Sin ganador");
            }
            else
            {
                System.Console.WriteLine("ganador = " + ConcursoPrueba.GetWinner().Name);
            }

            System.Console.WriteLine("Pulse enter para salir");
            System.Console.ReadLine();
        }
Exemple #20
0
    /// <summary>
    /// 정보 표시
    /// </summary>
    /// <param name="tr">표시될 위치 트랜스폼</param>
    /// <param name="doll">표시될 인형 정보</param>
    public void Show(Transform tr, Doll doll)
    {
        go.SetActive(true);
        sb.Length = 0;
        string color;

        switch (doll.dollData.rank)
        {
        case 2:
            color = "#DCEBFF";
            break;

        case 3:
            color = "#A7FAEB";
            break;

        case 4:
            color = "#8AE634";
            break;

        case 5:
            if ((doll.dollData.id < 1000) || (doll.dollData.id > 9999))
            {
                color = "#FFD73C";
            }
            else
            {
                color = "#FF98A3";
            }
            break;

        default:
            color = "white";
            break;
        }

        sb.Append("<Color=");
        sb.Append(color);
        sb.Append(">");
        sb.Append(doll.dollData.krName);
        sb.Append("</color>");
        sb.Append("\n");
        sb.Append(doll.dollData.rank);
        sb.Append("성 ");
        sb.Append(doll.dollData.type);
        text.text = sb.ToString();

        target = tr;
    }
        public void WearTest()
        {
            // Restricted wears
            Doll cloneBelle     = belle.Copy();     // Doll using a suit can't equip a necklace
            Doll cloneAnastasia = anastasia.Copy(); // Doll using a green dress can't equip a necklace
            Doll cloneDorothy   = dorothy.Copy();   // Doll using a purse can't equip a new purse;
            Doll cloneNataliya  = nataliya.Copy();  // Doll without a dress can't equip anything else

            Dress    belleSuit     = cheapBlackOfficeSuit.Copy() as Dress;
            Purse    bellePurse    = cheapPurseA.Copy() as Purse;
            Necklace belleNecklace = fantasyNecklaceA.Copy() as Necklace;

            cloneBelle.Wear(belleSuit);
            cloneBelle.Wear(bellePurse);
            cloneBelle.Wear(belleNecklace);

            Assert.AreEqual(cloneBelle.TotalAccessories, 2);

            Dress    anastasiaDress    = greenPartyDress.Copy() as Dress;
            Necklace anastasiaNecklace = diamondNecklace.Copy() as Necklace;

            cloneAnastasia.Wear(anastasiaDress);

            Assert.AreEqual(cloneAnastasia.Wear(anastasiaNecklace), false);

            Dress dorothyDress    = blueCasualDress.Copy() as Dress;
            Purse dorothyPurse    = midPurse.Copy() as Purse;
            Purse dorothyNewPurse = premiumPurse.Copy() as Purse;

            cloneDorothy.Wear(dorothyDress);
            cloneDorothy.Wear(dorothyPurse);

            Assert.AreEqual(dorothy.Wear(dorothyNewPurse), false);

            Assert.AreEqual(cloneNataliya.Wear(belleNecklace), false);
            Assert.AreEqual(cloneNataliya.TotalAccessories, 0);

            // CloneNataliya can equip only up to 5 bracelets
            cloneNataliya.Wear(belleSuit);

            for (int i = 0; i < 10; i++)
            {
                cloneNataliya.Wear(diamondBracelet.Copy());
            }

            Assert.AreEqual(cloneNataliya.BraceletCount, 5);
        }
Exemple #22
0
    // === STATE MACHINE ===========================================================================

    public IEnumerator StartBattleRoutine()
    {
        battle.SetUpWithController(this);

        foreach (BattleUnit unit in battle.UnitsByAlignment(Alignment.Enemy))
        {
            Doll doll = enemySelect.AssignNextDoll(unit);
            dolls[unit] = doll;
        }
        foreach (BattleUnit unit in battle.UnitsByAlignment(Alignment.Hero))
        {
            Doll doll = allySelect.AssignNextDoll(unit);
            dolls[unit] = doll;
        }

        yield return(battle.BattleRoutine());
    }
Exemple #23
0
        public void AddDollToEchelon(Doll doll, int echelon, int slot)
        {
            if (echelon > 9)
            {
                //TODO drag
            }
            EchelonButton.Name       = $"FormationPage/Echelon{echelon.ToString()}";
            EchelonClickedScene.Name = $"FormationPage/Echelon{echelon.ToString()}Clicked";
            if (!screen.Exists(EchelonClickedScene, 1000))
            {
                screen.Click(EchelonButton);
            }
            var area = SlotArea(new Point(220 + (160 * (slot - 1)), 290));

            screen.Click(area, FilterDollButton);
            SelectDoll(doll);
        }
 static void Main(string[] args)
 {
     Person brother = new Person();
     ActionMan am = new ActionMan();
     am.guns = "Laser Beam";
     brother.actionMan = am;
     Person sister = new Person();
     Doll d = new Doll();
     d.name = "Jill";
     sister.doll = d;
     Serialize(brother, "brother.xml");
     Serialize(sister, "sister.xml");
     Person b = Deserialize("brother.xml");
     Person s = Deserialize("sister.xml");
     Console.WriteLine(((ActionMan)b.toy).guns);
     Console.WriteLine(((Doll)s.toy).name);
     Console.Read();
 }
Exemple #25
0
    /// <summary>
    /// 포인터가 가르키는 위치의 인형 선택
    /// </summary>
    /// <param name="num">tile 위치</param>
    public void SelectTile(int num)
    {
        //타일 밖이면 리턴
        if (num < 1)
        {
            return;
        }
        //모든 타일에 활성화된 이미지를 off이미지로 변경(체인된 딜리게이트)
        AllImageOff();

        //선택한 인형이 주는 버프 계산
        CalcIndiBuff(num);

        //기존에 선택되어있는 인형이 null이 아니고 지금 선택한 타일과 다른곳에 있으면
        //인형상태를 대기로 변경
        if (selectedDoll != null && selectedDoll != tiles[num - 1].doll)
        {
            selectedDoll.SetState(Doll.DollState.Idle);
        }

        //인형 info 말풍선 생성
        SingleTon.instance.info.SetInfo(tiles[num - 1].doll);

        //선택된어있는 인형 해당 타일의 인형으로 변경
        selectedDoll = tiles[num - 1].doll;

        //감산 버프적용시 재계산
        if (lossBuff)
        {
            CalcBuff();
        }

        //선택한 타일에 인형이 null이면 리턴
        if (tiles[num - 1].doll == null)
        {
            return;
        }

        //선택한 타일의 이미지 선택상태로 변경
        tiles[num - 1].SelectImage();
        //선택한 타일의 인형 상태 선택상태로 변경
        tiles[num - 1].doll.SetState(Doll.DollState.Selected);
    }
Exemple #26
0
        void ReflectDecisionsToDoll(double[] unknowns, Doll doll)
        {
            int idx = 1; // idx = 0 is used by the field of view

            // Center position
            doll.SetRootLocation(new Vector3(
                                     (float)unknowns[idx++],
                                     (float)unknowns[idx++],
                                     (float)unknowns[idx++]));

            // Angles
            foreach (var part in _targetParts)
            {
                doll.SetEulerAngle(part, new EulerAngle(
                                       (float)unknowns[idx++],
                                       (float)unknowns[idx++],
                                       (float)unknowns[idx++]));
            }
        }
Exemple #27
0
    /// <summary>
    /// 인형 스폰
    /// </summary>
    /// <param name="doll"></param>
    /// <param name="selecter">인형을 스폰하는 셀렉터</param>
    public void Spawn(Doll doll, DollSelecter.Select selecter)
    {
        if (selecter.gridPos - 1 < 0)
        {
            return;
        }
        //셀렉터가 가르키는 타일에 이미 인형이 있으면 해당 타일의 인형을 디스폰
        if (tiles[selecter.gridPos - 1].doll != null)
        {
            Despawn(selecter.gridPos);
        }
        //셀렉터에 인형의 초상화 설정
        selecter.image.sprite = doll.profilePic;
        //인형 개별버프 초기화
        ResetIndiBuff();
        //모든 이미지오프 딜리게이트 실행
        AllImageOff();

        if (doll.go.activeSelf)
        {
            //스폰하려는 인형이 이미 다른타일에 있으면, 해당인형의 셀렉터의 초상화를 지움
            doll.selecter.image.sprite = SingleTon.instance.nullButtonSprite;
            //이미 다른타일에 있는 인형을 스폰하고자하는 셀렉터의 위치로 옮김
            MoveTo(doll.pos, selecter.gridPos, false);
        }
        else
        {
            //그렇지 않으면 일반 스폰 진행
            doll.Spawn(tiles[selecter.gridPos - 1].tr);
            //인형의 Pos에 셀렉터의 gridPos 할당
            doll.pos = selecter.gridPos;
            //해당 타일의 인형에 스폰한 인형, 셀렉터 할당
            //해당 타일의 미니버프 설정
            tiles[selecter.gridPos - 1].doll     = doll;
            tiles[selecter.gridPos - 1].selecter = selecter;
            tiles[selecter.gridPos - 1].miniBuff.SetMiniBuff(doll.dollData);
        }
        //인형의 셀렉터에 스폰한 셀렉터 할당.
        doll.selecter = selecter;
        //전체 버프 계산
        CalcBuff();
    }
Exemple #28
0
    /// <summary>
    /// 전부 초기화
    /// </summary>
    /// <param name="showMsg">초기화 매시지를 출력할까?</param>
    public void ResetAll(bool showMsg = true)
    {
        selectedDoll = null;
        ResetIndiBuff();
        AllImageOff();
        if (showMsg)
        {
            SingleTon.instance.msg.SetMsg("초기화");
        }

        for (int i = 0; i < tiles.Length; i++)
        {
            if (tiles[i].doll == null)
            {
                continue;
            }
            Despawn(i + 1);
        }

        CalcBuff();
    }
Exemple #29
0
        // --- private ---
        void InitializeInputArrays(Doll doll, out double[] unknowns, out double[] lowerLimits, out double[] upperLimits)
        {
            var unknownList    = new List <double>();
            var lowerLimitList = new List <double>();
            var upperLimitList = new List <double>();

            // Field of view
            unknownList.Add(System.Math.PI / 4); // Initial assumption is 45 degree
            lowerLimitList.Add(30 * System.Math.PI / 180);
            upperLimitList.Add(50 * System.Math.PI / 180);

            // Center position
            for (int i = 0; i < 3; i++)
            {
                unknownList.Add(0.0); // Origin
                lowerLimitList.Add(double.MinValue);
                upperLimitList.Add(double.MaxValue);
            }

            // Angles
            foreach (var part in _targetParts)
            {
                // Heading-Pitch-Bank order
                for (int i = 0; i < 3; i++)
                {
                    unknownList.Add(0.0);                         // No rotation
                }
                var limit = doll.GetEulerAngleLimit(part);
                lowerLimitList.Add(limit.Min.HeadingDeg);
                lowerLimitList.Add(limit.Min.PitchDeg);
                lowerLimitList.Add(limit.Min.BankDeg);
                upperLimitList.Add(limit.Max.HeadingDeg);
                upperLimitList.Add(limit.Max.PitchDeg);
                upperLimitList.Add(limit.Max.BankDeg);
            }

            unknowns    = unknownList.ToArray();
            lowerLimits = lowerLimitList.ToArray();
            upperLimits = upperLimitList.ToArray();
        }
        static void Main(string[] args)
        {
            Doll vader   = new Doll("Vader");
            Doll trooper = new Doll("Storm Trooper");
            Doll tarken  = new Doll("Grand Moff Tarken");
            Doll pilot   = new Doll("Pilot");
            Doll raider  = new Doll("Raider");
            Doll luke    = new Doll("Luke");

            vader.Inner   = trooper;
            trooper.Inner = tarken;
            tarken.Inner  = pilot;
            pilot.Inner   = raider;

            // insert Luke between Trooper and Tarken
            luke.Outer = trooper;
            luke.Inner = tarken;

            Console.WriteLine(tarken.Name);
            Console.WriteLine(tarken.Outer.Name);
            Console.WriteLine(tarken.Inner.Name);


            Console.WriteLine("\n\nOn to people!");

            Person ma      = new Person("Luci");
            Person pa      = new Person("Jim");
            Person michael = new Person("Michael", ma, pa);
            Person chris   = new Person("Chris", ma, pa);
            Person john    = new Person("John", ma, pa);

            chris.AddSibling(michael);
            michael.AddSibling(chris);
            john.AddSibling(michael);


            Console.WriteLine("Chris' brother Michael's siblings:");
            chris.GetSibling("Michael").GetSiblings().ForEach(sibling => Console.WriteLine(sibling.Name));
        }
Exemple #31
0
    private void MoveSelection(int delta)
    {
        Doll oldSelected = GetSelectedDoll();

        if (oldSelected != null)
        {
            oldSelected.GetComponent <Selectable>().selected = false;
        }

        int max = dolls.Count;

        do
        {
            selectionIndex += delta;
            if (selectionIndex < 0)
            {
                selectionIndex = max - 1;
            }
            else if (selectionIndex >= max)
            {
                selectionIndex = 0;
            }
        } while (GetSelectedDoll().unit.IsDead());

        Doll newSelected = GetSelectedDoll();

        newSelected.GetComponent <Selectable>().selected = true;
        if (newSelected.unit.align == Alignment.Enemy)
        {
            StartCoroutine(newSelected.unit.battle.controller.enemyHUD.enableRoutine(newSelected.unit));
        }

        if (oldSelected != newSelected)
        {
            Global.Instance().Audio.PlaySFX("cursor");
        }
    }
Exemple #32
0
 public void OnDollDeath()
 {
     dollSpawned = false;
     currDoll = null;
     StartCoroutine(SpawnWaiting());
 }