public void Dosomething() { DoNothing d = delegate(double x, double y, double v) { return(x + y); }; d.Invoke(5, 6, 7); d += new DoNothing(la); }
public override void Compile(LinkedListNode<Token> node, Listitem lastInsertedAction) { node = node.Next; if (node.Value.Text == "(") { DoNothing end = new DoNothing(); JumpConditional jc = new JumpConditional(); jc.Condition = GetExpression(ref node); jc.OnTrue = new DoNothing(); ActionList.AddLast(jc); ActionList.AddLast(jc.OnTrue); node = node.Next; if (node.Value.Text == "{") { List<LinkedListNode<Token>> statement = GetStatement(ref node); Jump tmpjump = new Jump(); tmpjump.Goto = end; tmpjump.Statement = statement; ActionList.AddLast(tmpjump); } // Hier moet eigelijk nog een else check komen jc.OnFalse = end; ActionList.AddLast(end); } else Console.WriteLine("Expected '(' exception"); }
public Player() { QAbility = new DoNothing(); WAbility = new DoNothing(); EAbility = new DoNothing(); RAbility = new DoNothing(); Item1 = new NoItem(); Item2 = new NoItem(); Item3 = new NoItem(); Item4 = new NoItem(); //maybe comment these out eventually and put them somewhere else/better? idk, seems cluttered here tho. Attack = 2; AttackChance = 50; Awareness = 15; Color = Colors.Player; Defense = 2; DefenseChance = 40; Gold = 0; Health = 100; MaxHealth = 100; Name = "Rogue"; Speed = 10; Symbol = '@'; }
public override object[] Reduce(Enviroment env, ErrorHandling errorHandling) { BaseStatement statement; if (Status.Reducible) { var reduceValue = Status.Reduce(env); if (reduceValue.GetType().IsSubclassOf(typeof(BaseError))) { statement = new Throw((BaseError)reduceValue); } else { statement = new SetObjectActive(Object, reduceValue); } } else { if (Status.GetType() != typeof(IceKoriBool)) { statement = new Throw(new TypeError($"Constant value \"{Status}\" cannot be converted to a bool")); } else { Object.SetActive(((IceKoriBool)Status).Value); statement = new DoNothing(); } } return(new object[] { statement, env, errorHandling }); }
public override ICommand GetCommand(IControlledCharacter character) { var result = new DoNothing(); result.SetDuration(30); return(result); }
private void Start() { keySpace = new PerformJump(); keyQ = new PerformKick(); keyR = new PerformPunch(); keyW = new PerformWalk(); keyE = new DoNothing(); anim = actor.GetComponent <Animator>(); }
public string Get(int id) { for (int i = 0; i < id; i++) { var test = _backgroundJobClient.Enqueue(() => DoNothing.Nothing(1)); } return("value"); }
public Player() { QAbility = new DoNothing(); WAbility = new DoNothing(); EAbility = new DoNothing(); RAbility = new DoNothing(); Item1 = new NoItem(); Item2 = new NoItem(); Item3 = new NoItem(); Item4 = new NoItem(); }
void Start() { //Bind keys with commands buttonB = new DoNothing(); buttonW = new MoveUp(); buttonS = new MoveDown(); buttonA = new MoveLeft(); buttonD = new MoveRight(); elementStartPos = elementTrans.position; }
private void Start() { // Get components for moving and teleporting PMC = PlayerGameObject.GetComponent <MovementComponent>(); PTC = PlayerGameObject.GetComponent <TeleportComponent>(); // bind Command to Class buttonW = new MoveForward(PMC); buttonS = new MoveBackwards(PMC); buttonShift = new Teleport(PTC); nothing = new DoNothing(PMC); }
void Start() { //Bind keys with commands buttonB = new DoNothing(); buttonW = new MoveForward(); buttonS = new MoveReverse(); buttonA = new MoveLeft(); buttonD = new MoveRight(); buttonZ = new UndoCommand(); buttonR = new ReplayCommand(); boxStartPos = boxTrans.position; }
public new static DoNothing FromJsonToken(JToken token) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Invalid comparison between Unknown and I4 //IL_000f: Unknown result type (might be due to invalid IL or missing references) if ((int)token.get_Type() != 1) { Debug.LogWarning((object)("Malformed token : type Object expected, but " + token.get_Type() + " found")); return(null); } JObject jsonObject = Extensions.Value <JObject>((IEnumerable <JToken>)token); DoNothing doNothing = new DoNothing(); doNothing.PopulateFromJson(jsonObject); return(doNothing); }
public static AIMovementDefinition FromJsonToken(JToken token) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Invalid comparison between Unknown and I4 //IL_000f: Unknown result type (might be due to invalid IL or missing references) if ((int)token.get_Type() != 1) { Debug.LogWarning((object)("Malformed token : type Object expected, but " + token.get_Type() + " found")); return(null); } JObject val = Extensions.Value <JObject>((IEnumerable <JToken>)token); JToken val2 = default(JToken); if (!val.TryGetValue("type", ref val2)) { Debug.LogWarning((object)"Malformed json: no 'type' property in object of class AIMovementDefinition"); return(null); } string text = Extensions.Value <string>((IEnumerable <JToken>)val2); AIMovementDefinition aIMovementDefinition; switch (text) { case "DoNothing": aIMovementDefinition = new DoNothing(); break; case "GetCloserTo": aIMovementDefinition = new GetCloserTo(); break; case "StayOutOfAttack": aIMovementDefinition = new StayOutOfAttack(); break; case "RunawayFrom": aIMovementDefinition = new RunawayFrom(); break; default: Debug.LogWarning((object)("Unknown type: " + text)); return(null); } aIMovementDefinition.PopulateFromJson(val); return(aIMovementDefinition); }
public Player() { AttackMessages = new string[] { "You thrash at the", "You fiercly lunge at the", "You tighten your grip and swing at the" }; GreetMessages = new string[] { "You begin your quest to defeat the DragonLord", "You embark on your journey to slay the Dragonlord", "Good luck on your journey" }; DeathMessages = new string[] { "You are dead, not a big surprise", "You fall over dead", "You crumble down to the floor and breathe your last", "You died" }; Attack = 2; AttackChance = 40; Awareness = 13; Color = Colors.Player; Defense = 1; DefenseChance = 15; Gold = 50; Health = 20; MaxHealth = 20; Mana = 10; MaxMana = 10; Name = "Novice"; Speed = 10; Level = 1; MaxLevel = 16; Experience = 8; TotalExperience = 0; Hunger = 1000; MaxHunger = 1200; Symbol = '@'; Status = "Healthy"; Inventory = new Inventory(this); Inventory.AddInventoryItem(new FoodRation(2)); QAbility = new DoNothing(); WAbility = new DoNothing(); EAbility = new DoNothing(); RAbility = new DoNothing(); XAbility = new Look(); HPRegen = new RegainHP(1, 10); MPRegen = new RegainMP(1, 20); State = new DoNothing(); Item1 = new HealingPotion(); Item2 = new ManaPotion(); Item3 = new ToughnessPotion(); Item4 = new TeleportScroll(); }
public void CompleteShip(Attributes inAtt, int inID, FleetManager mng) { Debug.Log(gameObject.name); if (photonView == null) photonView = this.gameObject.GetComponent<PhotonView>(); manager = mng; attributes = inAtt; this.ID = inID; this.gameObject.name = "Ship_" + attributes.name + ID; this.tag = "Ship"; this.shipObject = this.gameObject; if (this.gameObject.GetComponent<Rigidbody>() == null) this.gameObject.AddComponent<Rigidbody>(); type = (ShipClass)Enum.Parse(typeof(ShipClass), attributes.type.ToUpper()); //modelName = shipModel.name; faction = attributes.faction; FactionTracker.Instance.GetFaction(faction).ShipCreated(); attributes.structureHealth = 100; this.gameObject.transform.localScale = attributes.initialScale; //transform.localScale = new Vector3(50,50,50); rigidbody.mass = attributes.mass; rigidbody.angularDrag = 1; rigidbody.drag = 0.2f; rigidbody.useGravity = false; behavior = new DoNothing(this); gameObject.tag = "AiShip"; PopulateRigPoints(); //PopulateCameraPoints(); if (photonView.isMine) CreateTurretsRandom(); else photonView.RPC("RequestTurretSyncRPC", PhotonTargets.MasterClient, PhotonNetwork.player.ID); CalculateAttributes(); buffs = new Buff(this); }
private bool RunOrder(IUnit unit) { IOrder order = new DoNothing(); try { order = unit.GetOrder(); } catch (Exception ex) { Console.WriteLine("Error in AI message:{0}", ex.Message); } if (order.IsValid(unit, Map)) { order.Execute(unit, Map); } unit.LastOrders.Add(order); return(order.FreeOrder()); }
public void ReturnType_Null() { DynamicMethod hello = new DynamicMethod("Hello", null, new Type[] { typeof(string) }, typeof(DynamicMethodTest).Module, true); Assert.AreEqual(typeof(void), hello.ReturnType, "#1"); ILGenerator helloIL = hello.GetILGenerator(); helloIL.Emit(OpCodes.Ret); DoNothing dn = (DoNothing)hello.CreateDelegate(typeof(DoNothing)); dn("whatever"); object[] invokeArgs = { "Hello, World!" }; object objRet = hello.Invoke(null, invokeArgs); Assert.IsNull(objRet, "#2"); }
public void Visit(IEntitySyncStateContext <AppointmentId, DateTime, IAppointmentItemWrapper, WebResourceName, string, IICalendar, IEventSynchronizationContext> syncStateContext, DoNothing <AppointmentId, DateTime, IAppointmentItemWrapper, WebResourceName, string, IICalendar, IEventSynchronizationContext> doNothing) { }
public static DoNothing FromJsonProperty(JObject jsonObject, string propertyName, DoNothing defaultValue = null) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Invalid comparison between Unknown and I4 JProperty val = jsonObject.Property(propertyName); if (val == null || (int)val.get_Value().get_Type() == 10) { return(defaultValue); } return(FromJsonToken(val.get_Value())); }
void BehaviorUpdates() { if (isFleetLeader && determiner == null && photonView.isMine) { Debug.Log("DetShip"); determiner = new BehaviorDeterminerAiShip(this); myFleet.ChangeLeader(this); } if (behavior == null) behavior = new DoNothing(this); if (isFleetLeader && photonView.isMine) determiner.Update(); behavior.CallUpdate(); }
public void Visit(DoNothing <AppointmentId, DateTime, AppointmentItemWrapper, WebResourceName, string, IICalendar> doNothing) { }
public override void visit(DoNothing node) { nextNode = node.getNextNode(); }
public abstract void visit(DoNothing node);