private static void RegisterBehaviours(IBehaviour behaviour, IMessagingClient client) { foreach (var handler in behaviour.GetMessageReceivedBehaviours()) { client.RegisterEventHandler(handler.EventType, handler.EventHandler); } }
public Enemy(GameWorld gameWorld, IBehaviour behaviour = null) : base(gameWorld) { DestroyEvent += CreateDeadBodyOnDestroyEvent; DestroyEvent += CreateLettersOnDestroyEvent; CollisionWithObjects += OnCollision; _behaviour = behaviour; }
public Blob(string name, int health, int damage, string behaviour, string attackType) { this.Name = name; this.Health = health; this.Damage = damage; this.AttackType = Engine.AttackFactory.CreateAttack(attackType, this); this.Behaviour = Engine.BehaviourFactory.CreateBehaviour(behaviour, this); this.InitialHealth = health; this.IsDead = false; }
public void OnMessage(IMessage message) { switch (message.MessageType) { case MessageType.CollisionEnter: { var collisionEnterMessage = message as CollisionEnterMessage; if (collisionEnterMessage == null) return; GameObject other = collisionEnterMessage.CollidingObject; behaviourStats = GameObject.GetBehaviourOfType("StatBehaviour"); if (!other.HasBehaviourOfType("WeaponBehaviour")) return; if (other != OwnSword) { hit(other); } } break; } }
public void AddBehaviour( IBehaviour behaviour ) { }
public bool TryGetBehaviour(string abbreviatedName, out IBehaviour behaviour) { lock (Behaviours) return(Behaviours.TryGetValue(abbreviatedName, out behaviour)); }
public MockDecoratorBehaviour(IBehaviour <MockContext> child) : base("MockDecoratorBehaviour", child) { }
private void ApplicationQuit(IBehaviour behaviour) { behaviour?.OnApplicationQuit(); }
public AttachBehaviourAction(IBehaviour behaviour, ITreeItem target) { _behaviour = behaviour; _treeItem = target; }
private void RenderBehaviourTree(Graphics graphics, int depth, IBehaviour <BtContext> behaviour) { RenderBehaviourTree(graphics, depth, (dynamic)behaviour); }
public Repeat(IBehaviour <TContext> child, int repeatCount) : this("Repeat", child, repeatCount) { }
/// <summary> /// Remove a behaviour from this HaptiQ /// </summary> /// <param name="behaviour"></param> public void removeBehaviour(IBehaviour behaviour) { lock (_behaviours) { _behaviours.Remove(behaviour); } }
public Cooldown(IBehaviour <TContext> child, int cooldownTimeInMilliseconds) : this("Cooldown", child, cooldownTimeInMilliseconds) { }
public Robot(string name, IBehaviour behaviour) { this.Name = name; this.Behaviour = behaviour; }
public Technology(IBehaviour behaviour) { _behaviour = behaviour; }
public bool AddBehaviour(IBehaviour behaviour) { lock (Behaviours) { if (!Behaviours.ContainsKey(behaviour.AbbreviatedName)) { behaviour.Initialize(this); Behaviours.Add(behaviour.AbbreviatedName, behaviour); return true; } } return false; }
/// <summary> /// Updates this behaviour based on an another behaviour /// </summary> /// <param name="behaviour"></param> public override void updateNext(IBehaviour behaviour) { base.updateNext(behaviour); NotificationBehaviour notificationBehaviour = behaviour as NotificationBehaviour; if (notificationBehaviour != null) { this._positions = notificationBehaviour._positions; } }
/// <summary> /// Adds a behaviour to the game object. /// </summary> /// <param name="behaviour">The behaviour to add.</param> public void AddBehaviour(string i, IBehaviour behaviour) { behaviour.GameObject = this; behaviours.Add(i, behaviour); }
public void AttachBehaviour( ITreeItem target, IBehaviour behaviour) { _memento.Record(@"Attach behavour to '{0}'".FormatWith(target.Name), () => { target.Behaviours.Add( behaviour ); tryFire( ( ) => ItemsAddedOrRemoved, target ) ; }); }
public AttachBehaviourAction(IBehaviour behaviour, ITreeItem target ) { _behaviour = behaviour ; _treeItem = target ; }
public void SetBehaviour(IBehaviour behaviour) { _behaviour = behaviour; _behaviour.Initialize(); }
public static AgentMoc CreateAgent(ActorPaths actorPaths, IActorRef principal, IBehaviour behaviour, GuardianType guardianType) { return(new AgentMoc(actorPaths: actorPaths, time: 0, debug: false, principal: principal, behaviour: behaviour, guardianType: guardianType)); }
public void Remove(IBehaviour item) { item.Control = null; this.InnerList.Remove(item); }
public void AddBehaviour( IBehaviour behaviour ) { Behaviours.Add( behaviour ); }
public bool Contains(IBehaviour item) { return(this.InnerList.Contains(item)); }
public BehaviourController(Enemy enemy, Dray dray) { this.enemy = enemy; this.dray = dray; this.behaviour = new RandomWalkBehaviour(enemy); }
public Succeeder(IBehaviour <TContext> child) : this("Succeeder", child) { }
public void AddBehaviour(IBehaviour behaviour) { Behaviours.Add(behaviour); }
public Succeeder(string name, IBehaviour <TContext> child) : base(name, child) { }
public static Initialize Create(IActorRef target, IBehaviour message = null) { return(new Initialize(message: message, target: target)); }
// Adds child behaviours public void addBehaviour(IBehaviour child) { m_childBehaviours.AddLast(child); }
private void Destroy(IBehaviour behaviour) { behaviour.DoDestroy(); }
public bool TryGetBehaviour(string abbreviatedName, out IBehaviour behaviour) { lock (Behaviours) return Behaviours.TryGetValue(abbreviatedName, out behaviour); }
public virtual void AddBehaviour( IBehaviour behaviour ) { }
public bool AddBehaviour(IBehaviour behaviour) { Dictionary<string, IBehaviour> updatedBehaviours = new Dictionary<string, IBehaviour>(Behaviours); if (!updatedBehaviours.ContainsKey(behaviour.AbbreviatedName)) { behaviour.Initialize(this); updatedBehaviours.Add(behaviour.AbbreviatedName, behaviour); Behaviours = updatedBehaviours; return true; } return false; }
protected override void OnInit(IBehaviour o) { Behaviour.AfterInit(); }
private void Add(IBehaviour behaviour) { this.entity.Behaveable.AddBehaviour(behaviour); }
public SubTree(string name, IBehaviour <TContext> child) : base(name, child) { }
public void SetSteeringBehaviour(IBehaviour behaviour) { _steeringBehaviour = behaviour; }
public Cooldown(string name, IBehaviour <TContext> child, int cooldownTimeInMilliseconds) : base(name, child) { CooldownTimeInMilliseconds = cooldownTimeInMilliseconds; }
public void AddBehaviour(IBehaviour behaviour) { behaviour.Machine = Machine; behaviours.Add(behaviour); }
public override void Init(ControllerSettings settings) { base.Init(settings); _behaviour = ((AIControllerSettings)settings).Behaviour; _behaviour.Init(this); }
public Node(IBehaviour parent) { _actions = new List <IBehaviour>(); _parent = parent; _index = 0; }
/// <summary> /// Adds a new behaviour to the <see cref="BehaviourCollection"/> /// </summary> /// <param name="dependencyObject">The <see cref="DependencyObject"/> to which to add to</param> /// <param name="behaviour">The behaviour to add</param> internal static void AddBehaviour(DependencyObject dependencyObject, IBehaviour behaviour) { GetBehaviours(dependencyObject).Add(behaviour); }
//a method to add Behaviours to the entity public abstract void AddBehaviour(IBehaviour pBehaviour);
private AgentMoc(ActorPaths actorPaths, long time, bool debug, IActorRef principal, IBehaviour behaviour, GuardianType guardianType) : base(actorPaths: actorPaths, time: time, debug: debug, principal: principal) { _actorPaths = actorPaths; _guardianType = guardianType; this.InitializeAgent(behaviour: behaviour); }
private void CheckForBossAttack(GameObject sword) { if (player) { if (sword.Texture == Boss1Swordtexture) { behaviourStats = GameObject.GetBehaviourOfType("StatBehaviour"); (behaviourStats as StatBehaviour).TestosDown(1); } } }
public void AddBehaviour(IBehaviour behaviour) { }
public RouteBuilder WithBehaviour(IBehaviour behaviour) { actions.Add((r) => r.Behaviours.Add(behaviour)); return(this); }
/// <summary> /// Updates the clock of this behaviour based on an another behaviour /// </summary> /// <param name="behaviour"></param> public virtual void updateNext(IBehaviour behaviour) { if (behaviour != null && behaviour.GetType() == this.GetType()) { this.TIME = behaviour.TIME; } }
/// <summary> /// Add a behaviour to this HaptiQ /// </summary> /// <param name="behaviour"></param> public void addBehaviour(IBehaviour behaviour) { lock (_behaviours) { _behaviours.Add(behaviour); } }