private static CustomPopupPlacement GetUpPopupPlacement(ComboBoxPopup popup, PositioningData data)
        {
            var upVerticalOffsetIndepent = DpiHelper.TransformToDeviceY(data.MainVisual, popup.UpVerticalOffset);
            var newY = upVerticalOffsetIndepent - data.PopupSize.Height + data.TargetSize.Height;

            return(new CustomPopupPlacement(new Point(data.OffsetX, newY), PopupPrimaryAxis.None));
        }
Пример #2
0
        /// <summary>
        ///     Keep trying to connect to I2C.
        ///     TODO: set timeout
        /// </summary>
        /// <returns></returns>
        public async Task ConnectI2c()
        {
            _Connection = new ConnectionI2c();

            do
            {
                await _Connection.Connect();
            }while (!_Connection.connected);

            ConfigurationRegisters = new ConfigurationRegisters(_Connection);
            DeviceListFunctions    = new DeviceListFunctions(_Connection);
            GeneralData            = new GeneralData(_Connection);
            PositioningData        = new PositioningData(_Connection);
            RegisterFunctions      = new RegisterFunctions(_Connection);
            SensorData             = new SensorData(_Connection);
            StatusRegisters        = new StatusRegisters(_Connection);
        }
Пример #3
0
 private static CustomPopupPlacement GetUpPopupPlacement(PositioningData data)
 {
     return(new CustomPopupPlacement(new Point(data.OffsetX, data.NewUpY), PopupPrimaryAxis.None));
 }
Пример #4
0
        private static CustomPopupPlacement GetClassicPopupPlacement(ComboBoxPopup popup, PositioningData data)
        {
            var defaultVerticalOffsetIndepent = DpiHelper.TransformToDeviceY(data.MainVisual, popup.DefaultVerticalOffset);
            var newY = data.LocationY + data.PopupSize.Height > data.ScreenHeight
                ? -(defaultVerticalOffsetIndepent + data.PopupSize.Height)
                : defaultVerticalOffsetIndepent + data.TargetSize.Height;

            return(new CustomPopupPlacement(new Point(data.OffsetX, newY), PopupPrimaryAxis.Horizontal));
        }
 private static CustomPopupPlacement GetUpPopupPlacement(PositioningData data)
 {
     return new CustomPopupPlacement(new Point(data.OffsetX, data.NewUpY), PopupPrimaryAxis.None);
 }
        private static CustomPopupPlacement GetClassicPopupPlacement(ComboBoxPopup popup, PositioningData data)
        {
            var defaultVerticalOffsetIndepent = DpiHelper.TransformToDeviceY(data.MainVisual, popup.DefaultVerticalOffset);
            var newY = data.LocationY + data.PopupSize.Height > data.ScreenHeight
                ? -(defaultVerticalOffsetIndepent + data.PopupSize.Height)
                : defaultVerticalOffsetIndepent + data.TargetSize.Height;

            return new CustomPopupPlacement(new Point(data.OffsetX, newY), PopupPrimaryAxis.Horizontal);
        }
Пример #7
0
 public void FromBytes(byte[] data, ref int offset)
 {
     Positioning = new PositioningData(data, ref offset);
     Velocity = new Vector3Data(data, ref offset);
 }
Пример #8
0
 public RigidData(Vector3 position, Vector3 angle, Vector3 velo)
 {
     Positioning = new PositioningData(position, angle);
     Velocity = new Vector3Data(velo);
 }
Пример #9
0
 public RigidData()
 {
     Positioning = new PositioningData();
     Velocity = new Vector3Data();
 }
 private static CustomPopupPlacement GetClassicPopupPlacement(ComboBoxPopup popup, PositioningData data)
 {
     return(default(CustomPopupPlacement));
 }
        private static CustomPopupPlacement GetUpPopupPlacement(ComboBoxPopup popup, PositioningData data)
        {
            var upVerticalOffsetIndepent = DpiHelper.TransformToDeviceY(data.MainVisual, popup.UpVerticalOffset);
            var newY = upVerticalOffsetIndepent - data.PopupSize.Height + data.TargetSize.Height;

            return new CustomPopupPlacement(new Point(data.OffsetX, newY), PopupPrimaryAxis.None);
        }
        private static CustomPopupPlacement GetDownPopupPlacement(ComboBoxPopup popup, PositioningData data)
        {
            var downVerticalOffsetIndepent = DpiHelper.TransformToDeviceY(data.MainVisual, popup.DownVerticalOffset);

            return new CustomPopupPlacement(new Point(data.OffsetX, downVerticalOffsetIndepent), PopupPrimaryAxis.None);
        }
Пример #13
0
        private static CustomPopupPlacement GetDownPopupPlacement(ComboBoxPopup popup, PositioningData data)
        {
            var downVerticalOffsetIndepent = DpiHelper.TransformToDeviceY(data.MainVisual, popup.DownVerticalOffset);

            return(new CustomPopupPlacement(new Point(data.OffsetX, downVerticalOffsetIndepent), PopupPrimaryAxis.None));
        }
Пример #14
0
 public SpawnedPlayer(GameObject boat, RoomPlayerInfo info)
 {
     Boat = boat;
     Manager = boat.GetComponent<BoatManager>();
     Positioning = new PositioningData(Boat.transform.position, Boat.transform.eulerAngles);
     ShootBuffer = new ShootingData();
     HitBuffer = new List<HealthData>();
     Info = info;
     Updated = true;
 }