public UnitImpactHpExecutor(ContextLogic context, FormulaController logic, BattleAccessor battle, UnitsAccessor units)
 {
     _context = context;
     _logic   = logic;
     _battle  = battle;
     _units   = units;
 }
Beispiel #2
0
 public ConditionUnitMostHpChecker(ContextLogic logic, FormulaController formula, BattleAccessor battle, UnitsAccessor units)
 {
     _battle  = battle;
     _units   = units;
     _formula = formula;
     _logic   = logic;
 }
Beispiel #3
0
 public FormulaModCalculator(FormulaController formula, ContextLogic context, BattleAccessor battle, ExplorerAccessor explorer)
 {
     _context  = context;
     _battle   = battle;
     _formula  = formula;
     _explorer = explorer;
 }
Beispiel #4
0
 public FormulaUnitParamCalculator(FormulaController formula, ContextLogic context, BattleAccessor battle, UnitsAccessor units, PlayerAccessor player)
 {
     _formula = formula;
     _player  = player;
     _context = context;
     _units   = units;
     _battle  = battle;
 }
        public BattleParamData CalculateStreath(int mobId, FormulaController formulaLogic)
        {
            var mob = GetMob(mobId);

            return(new BattleParamData()
            {
                Value = (float)formulaLogic.Calculate(mob.Strength)
            });
        }
Beispiel #6
0
 public UnitImpactExpExecutor(ImpactController logic, FormulaController formula, ContextLogic context, UnitsAccessor units, PlayerAccessor player, BattleAccessor battle)
 {
     _formula = formula;
     _logic   = logic;
     _units   = units;
     _context = context;
     _battle  = battle;
     _player  = player;
 }
        public BattleParamData CalculateInitiative(int mobId, FormulaController formulaLogic)
        {
            var mob = GetMob(mobId);

            return(new BattleParamData()
            {
                Value = (float)formulaLogic.Calculate(mob.Initiative)
            });
        }
Beispiel #8
0
 public ImpactUnitAddExecutor(ImpactController impact, ContextLogic context, BattleLogic logic, FormulaController formula, UnitsAccessor units, ExplorerAccessor explorer, SettingsAccessor settings, BattleAccessor battle)
 {
     _impact   = impact;
     _context  = context;
     _formula  = formula;
     _settings = settings;
     _explorer = explorer;
     _units    = units;
     _battle   = battle;
     _logic    = logic;
 }
Beispiel #9
0
        public BattleParamData CalculateInitiative(IUnitData data, FormulaController formula)
        {
            var unit = Static.Units[data.Id];

            return(new BattleParamData
            {
                Value = (int)formula.Calculate(unit.Initiative),
                Equip = CalculateEquipInit(data.Id),
                Base = unit.Rarities.Where(x => x.Value.Stars == data.Stars).Sum(x => x.Value.Initiative),
            });
        }
 public double GetMaxHp(int unitId, FormulaController formula)
 {
     if (BattleMode)
     {
         var member = _battleAccessor.GetMember(unitId);
         return(member.HpMax.Value);
     }
     else
     {
         var unit = _unitAccessor.GetUnit(unitId);
         return(_unitAccessor.CalculateMaxHp(unit.data, formula).Value);
     }
 }
Beispiel #11
0
 public static ActivationModule CreateClient(FormulaController _formulaLogic, ImpactController _impactLogic, ExplorerAccessor _explorer, ScorersAccessor _scorers, PlayerAccessor Player, UnitsAccessor _units, ApplyChangeLogic _changeLogic)
 {
     return(new ActivationModule
     {
         _formulaLogic = _formulaLogic,
         _impactLogic = _impactLogic,
         _explorer = _explorer,
         _scorers = _scorers,
         Player = Player,
         _units = _units,
         _changeLogic = _changeLogic,
     }
            );
 }
Beispiel #12
0
    private void Awake()
    {
        if (GetComponent <VRTK_ControllerEvents>() == null)
        {
            VRTK_Logger.Error(VRTK_Logger.GetCommonMessage(VRTK_Logger.CommonMessageKeys.REQUIRED_COMPONENT_MISSING_FROM_GAMEOBJECT, "VRTK_ControllerEvents_ListenerExample", "VRTK_ControllerEvents", "the same"));
            return;
        }

        GetComponent <VRTK_ControllerEvents>().TriggerPressed  += new ControllerInteractionEventHandler(SnapobjectToController);
        GetComponent <VRTK_ControllerEvents>().TriggerReleased += new ControllerInteractionEventHandler(UnSnapObject);

        GetComponent <VRTK_ControllerEvents>().TouchpadPressed  += new ControllerInteractionEventHandler(UIPointerPressed);
        GetComponent <VRTK_ControllerEvents>().TouchpadReleased += new ControllerInteractionEventHandler(UIPointerReleased);

        GetComponent <VRTK_InteractTouch>().ControllerTouchInteractableObject   += new ObjectInteractEventHandler(onGrabbedTouched);
        GetComponent <VRTK_InteractTouch>().ControllerUntouchInteractableObject += new ObjectInteractEventHandler(onGrabbedUntouched);

        GetComponent <VRTK_InteractGrab>().ControllerGrabInteractableObject += GrabThrowable_ControllerGrabInteractableObject;

        autoGrab         = GetComponent <VRTK_ObjectAutoGrab>();
        autoGrab.enabled = false;

        Menu = LeftController.GetComponent <ThrowableMenuController>();
        if (Menu == null)
        {
            Debug.LogError("Error loading menu controller");
        }

        formulaController = GetComponent <FormulaController>();
        if (formulaController == null)
        {
            Debug.LogError("Error loading FormulaController controller");
        }

        sliderHandler = LeftController.GetComponent <SliderHandler>();
        if (sliderHandler == null)
        {
            Debug.LogWarning("Error fetching SliderHandler from left controller");
        }

        if (GC == null)
        {
            throw new NotImplementedException("Please attach the garbage collector Object to the grab throwable Script in Right controller");
        }
    }
Beispiel #13
0
 public InternalAccessors(LogicData LogicData, IStateFactory factory)
 {
     Factory             = factory;
     ConditionController = new ConditionController();
     FormulaController   = new FormulaController();
     AchievementAccessor = new AchievementAccessor();
     BattleAccessor      = new BattleAccessor();
     CutSceneAccessor    = new CutSceneAccessor();
     ExplorerAccessor    = new ExplorerAccessor();
     InventoryAccessor   = new InventoryAccessor();
     LogAccessor         = new LogAccessor();
     LogAccessor.Data    = LogicData;
     PlayerAccessor      = new PlayerAccessor();
     ScorersAccessor     = new ScorersAccessor();
     SettingsAccessor    = new SettingsAccessor();
     ShopAccessor        = new ShopAccessor();
     UnitsAccessor       = new UnitsAccessor();
 }
Beispiel #14
0
    /// <summary>
    /// 将数值和物理量名称加载到方块
    /// </summary>
    public void Show(string quantityName, FormulaController controller)
    {
        StatisticUncertainty.SetSelectorName(quantityName);
        StatisticAverage.SetSelectorName(quantityName);
        StatisticDeltaComplex.SetSelectorName(quantityName);
        StatisticKComplex.SetSelectorName(quantityName);

        var quantity = RecordManager.tempRecord.quantities.Find(x => x.Symbol.Equals(quantityName));

        if (quantity.processMethod == 1)
        {
            SetActiveHelper(true, true, false, false);
        }
        else if (quantity.processMethod == 2)
        {
            SetActiveHelper(true, false, true, false);
        }
        else if (quantity.processMethod == 3)
        {
            SetActiveHelper(true, false, false, true);
        }
        else if (quantity.processMethod == 4)
        {
            SetActiveHelper(false, false, false, true);
        }

        StatisticUncertainty.Title = "不确定度";
        StatisticUncertainty.Desc  = $"物理量\"{quantityName}\"合成后的不确定度";

        StatisticAverage.Title = "平均值";
        StatisticAverage.Desc  = $"物理量\"{quantityName}\"所有测量结果的平均值";

        StatisticDeltaComplex.Title = "变化量的平均值";
        StatisticDeltaComplex.Desc  = $"物理量\"{quantityName}\"经过逐差后的平均值";

        StatisticKComplex.Title = "变化率(斜率)";
        StatisticKComplex.Desc  = $"物理量\"{quantityName}\"一元线性回归法或图示法处理数据后获得的斜率值";

        StatisticUncertainty.FormulaControllerInstance  = controller;
        StatisticAverage.FormulaControllerInstance      = controller;
        StatisticDeltaComplex.FormulaControllerInstance = controller;
        StatisticKComplex.FormulaControllerInstance     = controller;
    }
Beispiel #15
0
    private void SnapobjectToController(object sender, ControllerInteractionEventArgs e)
    {
        //get formulaController for sure
        formulaController = GetComponent <FormulaController>();
        formulaController.callibrate();

        //disable softbody script when touching with controller to be grabbable
        try
        {
            TxSoftBody softRB = this.touchingObject.GetComponent <TxSoftBody>();
            softRB.enabled = false;
        } catch (Exception error)
        {
            Debug.Log(error.StackTrace.ToString());
        }
        GameObject        throwable     = null;
        GameObject        grabbedObject = GameObject.Find("grabbedObject");
        VRTK_InteractGrab grab          = GetComponent <VRTK_InteractGrab>();

        try
        {
            foreach (Transform child in grabbedObject.transform)
            {
                throwable = child.gameObject;
                throwable.transform.parent = null;
                throwable.transform.SetParent(GC.transform);
                throwable.transform.position = transform.position;
                throwable.GetComponent <Rigidbody>().isKinematic = false;
                grab.AttemptGrab();
                this.grabbedGo = throwable;

                OnGrabbed(throwable, new Vector3());
            }
        }
        catch (Exception error)
        {
            Debug.LogWarning("Can not snap object to right controller - " + error.ToString());
        }
    }
Beispiel #16
0
 public static StartSessionModule CreateClient(UnitsAccessor _units, ScorersAccessor _scorers, BattleAccessor _battle, InventoryAccessor _inventory, PlayerAccessor _player, ExplorerAccessor _explorer, LogAccessor _accessor, SettingsAccessor _settings, ShopAccessor _shop, LogAccessor _log, AchievementAccessor _achievement, BattleLogic _battleLogic, ShopLogic _shopLogic, ExplorerLogic _explorerLogic, FormulaController _formula, ImpactController _logic)
 {
     return(new StartSessionModule
     {
         _units = _units,
         _scorers = _scorers,
         _battle = _battle,
         _inventory = _inventory,
         _player = _player,
         _explorer = _explorer,
         _accessor = _accessor,
         _settings = _settings,
         _shop = _shop,
         _log = _log,
         _achievement = _achievement,
         _battleLogic = _battleLogic,
         _shopLogic = _shopLogic,
         _explorerLogic = _explorerLogic,
         _formula = _formula,
         _logic = _logic,
     }
            );
 }
Beispiel #17
0
 public FormulaDiffCalculator(FormulaController logic)
 {
     _logic = logic;
 }
Beispiel #18
0
 public ImpactUnitSetExecutor(UnitsAccessor accessor, FormulaController formula)
 {
     _formula  = formula;
     _accessor = accessor;
 }
Beispiel #19
0
 public ImpactPauseExecutor(ApplyChangeLogic logic, FormulaController formula, ContextLogic context)
 {
     _context = context;
     _logic   = logic;
     _formula = formula;
 }
 public FormulaBaseCalculator(FormulaController logic)
 {
     _logic = logic;
 }
 public FormulaIfCalculator(FormulaController formula, ConditionController condition)
 {
     _condition = condition;
     _formula   = formula;
 }
Beispiel #22
0
 public static ShopLogic CreateClient(SettingsAccessor _settings, ShopAccessor _shop, FormulaController _formula)
 {
     return(new ShopLogic
     {
         _settings = _settings,
         _shop = _shop,
         _formula = _formula,
     }
            );
 }
Beispiel #23
0
 public static AchievementModule CreateClient(AchievementAccessor _accessor, ScorersLogic _scorersLogic, DropLogic _dropLogic, FormulaController _formula, ImpactController _impacts)
 {
     return(new AchievementModule
     {
         _accessor = _accessor,
         _scorersLogic = _scorersLogic,
         _dropLogic = _dropLogic,
         _formula = _formula,
         _impacts = _impacts,
     }
            );
 }
Beispiel #24
0
 public FormulaMultCalculator(FormulaController logic)
 {
     _logic = logic;
 }
 public FormulaRandCalculator(FormulaController logic, LogicData data)
 {
     _data  = data;
     _logic = logic;
 }
Beispiel #26
0
 public static BattleLogic CreateClient(ApplyChangeLogic _manager, ContextLogic _context, ConditionLogic _condition, FormulaController _formula, BattleAccessor _battle, ScorersAccessor _scorers, UnitsAccessor _units, ExplorerAccessor _explorer, SettingsAccessor _settings)
 {
     return(new BattleLogic
     {
         _manager = _manager,
         _context = _context,
         _condition = _condition,
         _formula = _formula,
         _battle = _battle,
         _scorers = _scorers,
         _units = _units,
         _explorer = _explorer,
         _settings = _settings,
     }
            );
 }
Beispiel #27
0
 public static ExplorerLogic CreateClient(ScorersAccessor _scorers, ExplorerAccessor _explorer, UnitsAccessor _units, FormulaController _formula, ScorersLogic _scorersLogic, ContextLogic _context, DropLogic _drop, ImpactController _impact)
 {
     return(new ExplorerLogic
     {
         _scorers = _scorers,
         _explorer = _explorer,
         _units = _units,
         _formula = _formula,
         _scorersLogic = _scorersLogic,
         _context = _context,
         _drop = _drop,
         _impact = _impact,
     }
            );
 }
Beispiel #28
0
 public static FormulaLogic CreateClient(ContextLogic _contextLogic, ScorersAccessor _scorers, UnitsAccessor _units, BattleAccessor _battle, ExplorerAccessor _explorer, LogicData _data, PlayerAccessor _player, SettingsAccessor _settings, ConditionController _controller, FormulaController _formula, ScorersLogic _scorerLogic)
 {
     return(new FormulaLogic
     {
         _contextLogic = _contextLogic,
         _scorers = _scorers,
         _units = _units,
         _battle = _battle,
         _explorer = _explorer,
         _data = _data,
         _player = _player,
         _settings = _settings,
         _controller = _controller,
         _formula = _formula,
         _scorerLogic = _scorerLogic,
     }
            );
 }
 public FormulaModObjectsCalculator(FormulaController formula)
 {
     _logic = formula;
 }
Beispiel #30
0
 public static DropLogic CreateClient(ScorersAccessor _scorers, InventoryAccessor _inventory, UnitsAccessor _units, ExplorerAccessor _explorer, FormulaController _formula, ImpactController _impact)
 {
     return(new DropLogic
     {
         _scorers = _scorers,
         _inventory = _inventory,
         _units = _units,
         _explorer = _explorer,
         _formula = _formula,
         _impact = _impact,
     }
            );
 }