示例#1
0
        internal void ShowAvailableOrders()
        {
            PowerUpAmountLabel.Visible = false;
            // first get the available power-ups from the aircraft
            var availablePowerUps = Aircraft.AvailablePowerUps();
            //Console.WriteLine("availablePowerUps: " + availablePowerUps);
            // then create fitting FlightPathHeadOptions
            var availableHeadOptions = new List <FlightPathHeadOption>();

            foreach (var powUpT in availablePowerUps)
            {
                if (powUpT != Head.pType)
                {
                    availableHeadOptions.Add(PowerUp.FlightPathHeadOptionFromType(powUpT));
                }
            }
            // then place them
            float l = ContentSize.Width * 1.25f;

            for (int i = 0; i < availableHeadOptions.Count; i++)
            {
                var option = availableHeadOptions[i];
                AddChild(option);
                CCPoint relPos = CCPoint.Zero;
                switch (i)
                {
                case 0:
                    relPos = new CCPoint(0, -l);
                    break;

                case 1:
                    relPos = new CCPoint(0, l);
                    break;

                case 2:
                    relPos = new CCPoint(l, -l / 2);
                    break;

                case 3:
                    relPos = new CCPoint(l, l / 2);
                    break;
                }
                option.Position = Head.Position + relPos;
            }
        }
 internal void ResetHead()
 {
     FlightPathHead.Head = PowerUp.FlightPathHeadOptionFromType(PowerUp.PowerType.NORMAL);
 }