示例#1
0
        public Unit(string name, UnitTypes unitType, Faction side, IMovementBehavior movementBehavior, IAttackBehavior attackBehavior, ITargetBehavior targetBehavior)
        {
            _name = name;
            _experience = 50;
            _resources = 50;

            _side = side;

            _unitType = unitType;

            _movementBehavior = movementBehavior;
            _movementBehavior.Owner = this;

            _attackBehavior = attackBehavior;
            _attackBehavior.Owner = this;

            _targetBehavior = targetBehavior;
            _targetBehavior.Owner = this;

            _unitView = new UnitView(this, unitType);
        }
示例#2
0
 internal TargetHandler(ITargetBehavior target, WeakReference <MixedRealityExtensionApp> appRef, IActor attachedActor)
     : base(target, appRef, attachedActor)
 {
     RegisterActionHandler(target.Target, nameof(target.Target));
     RegisterActionHandler(target.Grab, nameof(target.Grab));
 }