Esempio n. 1
0
 public void Init(Legs legs,Grid grid)
 {
     base.Init(legs);
     this.grid = grid;
     this.auxiliarySteering = new Arrive();
     this.auxiliarySteering.Init(getLegs());
 }
    public override void DTRMStart()
    {
        base.DTRMStart();

        attack = GetComponent<Attack>();
        legs = GetComponent<Legs>();
    }
Esempio n. 3
0
 public void DoYourJob()
 {
     Console.WriteLine($"{Name} is doing all their {Job} duties...");
     Legs.Walk(15);
     Head.EatPie("Cherry");
     Torso.Flex();
     Legs.Walk(10);
 }
Esempio n. 4
0
    public override void DTRMStart()
    {
        base.DTRMStart();

        legs   = GetComponent <Legs>();
        vision = GetComponent <Vision>();
        attack = GetComponent <Attack>();
    }
Esempio n. 5
0
 public void DoYourJob(int stepsToWalk)
 {
     Console.WriteLine($"Doing all my {Job} duties...");
     Legs.Walk(stepsToWalk);
     Head.EatPie("Cherry");
     Torso.Flex();
     Legs.Walk(stepsToWalk);
 }
Esempio n. 6
0
 public void DoYourJob()
 {
     Console.WriteLine($"{Name} is doing all their {Job} duties...");
     Legs.Walk(15);
     Head.EatPie("pumpkin");
     Torso.Flex(); // because we are using TorsoBase, can only call common methods from the base. Can't use ChangeThermostat();
     Legs.Walk(10);
 }
Esempio n. 7
0
        //public SpaceGuy(string v1, string v2, ZoeHead head, AstronautTorso torso, AstronautLegs legs)
        //{
        //    this.v1 = v1;
        //    this.v2 = v2;
        //    this.head = head;
        //    this.torso = torso;
        //    this.legs = legs;
        //}

        public void DoYourJob(int stepsToWalk)
        {
            Console.WriteLine($"Here I am. Doing all my {Job} duties... definitely being a very effective {Job}.");
            Legs.Walk(stepsToWalk);
            Head.EatPie("Cherry");
            Torso.Flex();
            Legs.Walk(stepsToWalk);
        }
Esempio n. 8
0
    /// <summary> Находит и возвращает ноги </summary>
    /// <param name="legs_owner"> Хозяин ног (ноги должны быть его детьми) </param>
    static Legs Find_Legs(GameObject legs_owner)
    {
        Legs legs;

        legs = legs_owner.GetComponentInChildren <Legs>();

        return(legs);
    }
Esempio n. 9
0
        internal Itinerary WithLeg(Leg leg)
        {
            var newLegs = new List <Leg>(Legs.Count() + 1);

            newLegs.AddRange(Legs);
            newLegs.Add(leg);

            return(new Itinerary(newLegs));
        }
Esempio n. 10
0
        void itemImgSetter(int val, string imgPath)
        {
            switch (val)
            {
            case 0:
                Gun1.Load(imgPath);
                break;

            case 1:
                Gun2.Load(imgPath);
                break;

            case 2:
                Gun3.Load(imgPath);
                break;

            case 3:
                Head.Load(imgPath);
                break;

            case 4:
                Arms.Load(imgPath);
                break;

            case 5:
                Chest.Load(imgPath);
                break;

            case 6:
                Legs.Load(imgPath);
                break;

            case 7:
                ClassArmour.Load(imgPath);
                break;

            case 8:
                Ghost.Load(imgPath);
                break;

            case 9:
                Sparrow.Load(imgPath);
                break;

            case 10:
                Ship.Load(imgPath);
                break;

            case 11:
                SubClass.Load(imgPath);
                break;

            case 13:
                Embelm.Load(imgPath);
                break;
            }
        }
Esempio n. 11
0
        internal Itinerary AppendBy(Itinerary other)
        {
            var newLegs = new List <Leg>(Legs.Count() + other.Legs.Count());

            newLegs.AddRange(Legs);
            newLegs.AddRange(other.Legs);

            return(new Itinerary(newLegs));
        }
Esempio n. 12
0
 public void Awake()
 {
     if (instance != null)
     {
         Debug.LogWarning("More than one instance of Inventory found!");
         return;
     }
     instance = this;
 }
Esempio n. 13
0
        public String NameOfPart(int partNum)   // I am truly sorry for this method!
        {
            String name    = "";
            Part   thePart = parts[partNum];

            if (thePart is Head)
            {
                Head head = (Head)thePart;
                name  = "Head: " + thePart.PartName;
                name += " Class: " + (int)head.PartRank;
                name += " Scan Level: " + (int)head.EnemyScanAbility;
                name += " Missle Defense Rate: " + head.MissileInterceptionRate;
            }
            if (thePart is Core)
            {
                Core core = (Core)thePart;
                name  = "Core: " + thePart.PartName;
                name += " Class:" + (int)core.PartRank;
                name += " HP: " + core.MaxHp;
            }
            if (thePart is LeftArm)
            {
                LeftArm leftArm = (LeftArm)thePart;
                name  = "Left Arm: " + thePart.PartName;
                name += " Class: " + (int)leftArm.PartRank;
                name += " Blade Length: " + leftArm.SwordLength;
                name += " Blade Damage: " + leftArm.SwordDamage;
            }
            if (thePart is RightArm)
            {
                RightArm rightArm = (RightArm)thePart;
                name  = "Right Arm: " + thePart.PartName;
                name += " Class: " + (int)rightArm.PartRank;
                name += " Size: " + rightArm.ProjectileSize;
                name += " Damage: " + rightArm.Damage;
            }
            if (thePart is Shoulders)
            {
                Shoulders shoudlers = (Shoulders)thePart;
                name  = "Shoulder: " + thePart.PartName;
                name += " Class: " + (int)shoudlers.PartRank;
                name += " Size: " + shoudlers.MissleSize;
                name += " Damage: " + shoudlers.Damage;
            }
            if (thePart is Legs)
            {
                Legs legs = (Legs)thePart;
                name  = "Legs: " + thePart.PartName;
                name += " Class: " + (int)legs.PartRank;
                name += " Speed: " + legs.SpeedTilesPerSecond;
                name += " Hover: " + ((legs.Movement.Water != MoveQuality.none) ? "True" : "False");
                name += " Heat Resist: " + ((legs.Movement.Water != MoveQuality.none) ? "True" : "False");
            }

            return(name);
        }
Esempio n. 14
0
        protected void ManageReachingLegsTurnDirection(Vector3 logicLookDirection,
                                                       Vector3 movementTurnLogicDirection)
        {
            var legsLogicDirection  = GetLogicVector(Legs.transform.forward);
            var torsoLogicDirection = GetLogicVector(Torso.transform.forward);
            var angle = AngleCalculator.CalculateLogicAngle(legsLogicDirection,
                                                            movementTurnLogicDirection);

            Legs.TurnTowards(movementTurnLogicDirection);
        }
 public ActionResult Edit([Bind(Include = "LegsId,Picure,Instructions,Benefits,Sets")] Legs legs)
 {
     if (ModelState.IsValid)
     {
         db.Entry(legs).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(legs));
 }
Esempio n. 16
0
        static void Main(string[] args)
        {
            Console.WriteLine("Let's assemble a Lego character!");
            Console.WriteLine('\n');



            var head = new Head()
            {
                Name = "Mr. Lego"
            };

            Console.WriteLine('\n');


            head.Hair = "green";

            Console.WriteLine($"Without {head.Name}'s hat, his {head.Hair} hair danced in the wind.");

            head.MagnifyVision(true);
            Console.WriteLine('\n');



            var torso = new Torso()
            {
            };

            Console.WriteLine('\n');


            Parts.Torso.haveExtraSupplies(true);
            Console.WriteLine('\n');



            var arms = new Arms();

            Console.WriteLine('\n');


            Console.WriteLine($"{head.Name} asked...");
            arms.UseArms("rectangular");
            Console.WriteLine('\n');


            var legs = new Legs()
            {
            };

            Console.WriteLine('\n');

            Console.WriteLine($"He looked down at his {legs._legColor} legs.");
            legs.Walk("stubby");
        }
Esempio n. 17
0
        public override double CalculateMaxProfit()
        {
            MaxProfit = Legs.Sum((leg) => leg.CalculateFinalProfit(0));

            if (MaxProfit < 0)
            {
                throw new Exception("Bear Spread 的最大收益不应小于0");
            }

            return(MaxProfit);
        }
Esempio n. 18
0
        private Pattern GenerateSmartPattern(int lines)
        {
            var bins = TypeCode == "RACE_ORDER"
                ? PatternGenerator.CreateFectaPattern(lines, Legs.Length)
                : PatternGenerator.CreateSmartPattern(lines,
                                                      Legs.ToDictionary(l => l.LegOrder, l => l.Selections.Length));
            var pattern = new Pattern(bins.ToArray());

            SmartPickPatterns[lines] = pattern;
            return(pattern);
        }
Esempio n. 19
0
        public void LegsPowerIsSeventyFive()
        {
            // Arrange
            var legs = new Legs();

            // Act
            var power = legs.Power();

            // Assert
            Assert.Equal(75, power);
        }
        public ActionResult Create([Bind(Include = "LegsId,Picure,Instructions,Benefits,Sets")] Legs legs)
        {
            if (ModelState.IsValid)
            {
                db.Legs.Add(legs);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(legs));
        }
Esempio n. 21
0
        public override double CalculateMaxLose()
        {
            MaxLose = Legs.Sum((leg) => leg.CalculateFinalProfit(Put.StrikePrice));

            if (MaxLose > 0)
            {
                throw new Exception("Bear Spread 的最大损失不应大于0");
            }

            return(MaxLose);
        }
Esempio n. 22
0
        /// <summary>
        /// Gets the leg after the specified leg.
        /// </summary>
        /// <param name="leg">leg</param>
        /// <returns>The next leg, or null if this is the last leg.</returns>
        internal Leg NextLeg(Leg leg)
        {
            for (var it = Legs.GetEnumerator(); it.MoveNext();)
            {
                if (it.Current.sameValueAs(leg))
                {
                    return(it.MoveNext() ? it.Current : null);
                }
            }

            return(null);
        }
Esempio n. 23
0
        public override UnitState FixedUpdate()
        {
            var logicLookDirection = GetLogicVector(Parameters.LookLogicDirection);

            Torso.TurnTowards(logicLookDirection);
            Torso.AimAt(Parameters.AimAtDirection);

            ManageReachingLegsTurnDirection(logicLookDirection, logicLookDirection);

            Legs.StraightenUp();
            Torso.StraightenUp();
            return(this);
        }
Esempio n. 24
0
    public float GetSpeed()
    {
        Legs legsPart = legs.part as Legs;

        if (legsPart == null)
        {
            return(0.0f);
        }
        else
        {
            return(legsPart.speed);
        }
    }
Esempio n. 25
0
        public LegData(Legs legPos, GameObject gameObject, float angleRange, float startMaxRange, float arctanRotation)
        {
            this.legPos         = legPos;
            this.gameObject     = gameObject;
            this.currentAngle   = gameObject.transform.localEulerAngles.z;
            this.angleLimits    = new Vector2(currentAngle - angleRange / 2.0F, currentAngle + angleRange / 2.0F);
            this.startMaxRange  = startMaxRange;
            this.arctanRotation = arctanRotation;
            this.lr             = gameObject.GetComponent <LineRenderer>();
            this.spring         = null;

            originalLocalPos = gameObject.transform.localPosition;
        }
Esempio n. 26
0
 public void LoadAll()
 {
     Floors.LoadAll();
     Items.LoadAll();
     Creatures.LoadAll();
     Templates.LoadAll();
     Animations.LoadAll();
     Heads.LoadAll();
     Chests.LoadAll();
     Legs.LoadAll();
     Arms.LoadAll();
     Weapons.LoadAll();
     Shields.LoadAll();
 }
        // GET: Legs/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Legs legs = db.Legs.Find(id);

            if (legs == null)
            {
                return(HttpNotFound());
            }
            return(View(legs));
        }
Esempio n. 28
0
 public void AddLegs(Legs legs)
 {
     if (this.legs.part == null)
     {
         this.legs.part = legs;
         body.transform.localPosition += new Vector3(0, legs.height, 0);
         legs.gameObject.SetActive(true);
         legs.AddToRobot(this);
     }
     else
     {
         legs.gameObject.SetActive(false);
     }
 }
Esempio n. 29
0
        public void Walk(int numberOfSteps)
        {
            switch (Head.HeadGear)
            {
            case Hair hair:
                Console.WriteLine($"{Name} tossed his {hair.Length} {hair.Color} hair in the wind.");
                break;

            case Helmet helmet:
                Console.WriteLine($"{Name} wondered why he is wearing a {helmet.Color} helmat. He is just going on a walk.");
                break;
            }
            Legs.Walk(numberOfSteps);
        }
Esempio n. 30
0
 public bool GetApplyCommissionToBuy(int commoditySellID, int commodityBuyID)
 {
     if (Legs.Count > 0)
     {
         if (IsBuy)
         {
             return(Legs.Where(l => l.CommodityID == commoditySellID).Single().Leg.ApplyCommissionToBuy);
         }
         else
         {
             return(Legs.Where(l => l.CommodityID == commodityBuyID).Single().Leg.ApplyCommissionToBuy);
         }
     }
     return(Ask.ApplyCommissionToBuy);
 }
Esempio n. 31
0
 public double?GetBuyRatio(int sellID, int buyId)
 {
     if (Legs.Count > 0)
     {
         var leg = IsBuy ? Legs.Where(l => l.CommodityID == sellID).SingleOrDefault() : Legs.Where(l => l.CommodityID == buyId).SingleOrDefault();
         if (leg != null)
         {
             return((double)leg.SellRatio / (double)leg.BuyRatio);
         }
     }
     else if (SellRatio != null && BuyRatio != null)
     {
         return((double)SellRatio / BuyRatio);
     }
     return(null);
 }
Esempio n. 32
0
        public BearSpread(Position Leg1, Position Leg2)
        {
            Legs.Add(Leg1);
            Legs.Add(Leg2);

            Strategy = ComboStrategy.BearSpread;

            if (VaildateSameSymbol() && VaildateBearSpread())
            {
                IsVaildated = true;
            }
            else
            {
                IsVaildated = false;
            }
        }
Esempio n. 33
0
 void Awake()
 {
     legs = GetComponent<Legs>();
 }
Esempio n. 34
0
 public override void DTRMStart()
 {
     attack = GetComponent<Attack>();
     legs = GetComponent<Legs>();
     vision = GetComponent<Vision>();
 }
Esempio n. 35
0
 public HabboFigure SetLegs(Legs value)
 {
     _legs = value;
     return this;
 }
Esempio n. 36
0
 public void Init(Legs legs,Grid grid)
 {
     base.Init(legs);
     this.grid = grid;
 }
Esempio n. 37
0
 public void Init(Legs legs)
 {
     weight = 1.0f;
     internal_weight = 1.0f;
     this.legs = legs;
 }