コード例 #1
0
ファイル: Item.cs プロジェクト: Petethegoat/MorrowindUnity
    protected override void Initialize(K record, ReferenceData referenceData)
    {
        base.Initialize(record, referenceData);

        quantity  = referenceData.Quantity;
        ownerData = new OwnerData(referenceData.Owner, referenceData.Global, referenceData.Faction, referenceData.Rank);
    }
コード例 #2
0
 protected virtual void DoClick()
 {
     if (FOnClick != null && OwnerData.CanEdit())
     {
         FOnClick(this, null);
     }
 }
コード例 #3
0
        public override GameObject CreateGameObject(ReferenceData referenceData, Transform parent = null)
        {
            var gameObject = base.CreateGameObject(referenceData, parent);
            var ownerData  = new OwnerData(referenceData.Owner, referenceData.Global, referenceData.Faction, referenceData.Rank);

            Ingredient.Create(gameObject, this, referenceData);

            return(gameObject);
        }
コード例 #4
0
        public override bool MouseUp(MouseEventArgs e)
        {
            if (OwnerData.CanEdit() && HC.PtInRect(GetBoxRect(), e.X, e.Y))  // 点在了勾选框中
            {
                Checked = !FChecked;
            }

            return(base.MouseUp(e));
        }
コード例 #5
0
ファイル: PersonalLogger.cs プロジェクト: touky/Prateek
 ///-----------------------------------------------------------------
 public LogData(object owner0, object owner1, object owner2, LogType type, StringBlurp log)
 {
     Owners = new OwnerData()
     {
         Owner0 = owner0, Owner1 = owner1, Owner2 = owner2
     };
     Type      = type;
     Log       = log;
     Timestamp = Time.realtimeSinceStartup;
 }
コード例 #6
0
        public override GameObject CreateGameObject(ReferenceData referenceData, Transform parent = null)
        {
            var gameObject = base.CreateGameObject(referenceData, parent);
            var ownerData  = new OwnerData(referenceData.Owner, referenceData.Global, referenceData.Faction, referenceData.Rank);
            var uses       = referenceData.Health == -1 ? data.MaxUses : referenceData.Health;

            RepairItem.Create(gameObject, this, referenceData);

            return(gameObject);
        }
コード例 #7
0
        public override GameObject CreateGameObject(ReferenceData referenceData, Transform parent = null)
        {
            var gameObject = base.CreateGameObject(referenceData, parent);
            var ownerData  = new OwnerData(referenceData.Owner, referenceData.Global, referenceData.Faction, referenceData.Rank);

            var charge = referenceData.Charge == -1 ? data.MaxCharge : referenceData.Charge;

            Clothing.Create(gameObject, this, referenceData);

            return(gameObject);
        }
コード例 #8
0
        public IActionResult Get(long id)
        {
            OwnerData owner = _dataRepository.Get(id);

            if (owner == null)
            {
                return(NotFound("The owner record couldn't be found."));
            }

            return(Ok(owner));
        }
コード例 #9
0
 public override bool MouseDown(MouseEventArgs e)
 {
     if (OwnerData.CanEdit() && (e.Button == MouseButtons.Left) && HC.PtInRect(FButtonRect, e.X, e.Y))
     {
         DoPopup();
         return(true);
     }
     else
     {
         return(base.MouseDown(e));
     }
 }
コード例 #10
0
        public IActionResult Delete(long id)
        {
            OwnerData owner = _dataRepository.Get(id);

            if (owner == null)
            {
                return(NotFound("The Owner record couldn't be found."));
            }

            _dataRepository.Delete(owner);
            return(NoContent());
        }
コード例 #11
0
        public void TheChoiseOfUserIsFuelBike()
        {
            float currentAmountFuel      = 0;
            int   engineCapacityFuelBike = 0;

            Console.WriteLine("Please, type current engine capacity of Bike");
            try
            {
                engineCapacityFuelBike = Convert.ToInt32(Console.ReadLine());
            }
            catch (FormatException i_Error)
            {
                Console.WriteLine(i_Error);
                Console.ReadKey();
            }

            Console.Clear();
            String LicenseTypeOfFuelByke = String.Format(@"Please, type your license : 
1: A1
2: AA
3: AB
4: C");

            Console.WriteLine(LicenseTypeOfFuelByke);
            eLicense fuelBikeLicense = (eLicense)(Convert.ToInt32(Console.ReadLine()));

            Console.Clear();
            Console.WriteLine("Please type your current fuel ");
            try
            {
                float.TryParse(Console.ReadLine(), out currentAmountFuel);
            }
            catch (FormatException i_Error)
            {
                Console.WriteLine(i_Error.Message);
                Console.ReadKey();
            }

            Console.Clear();
            if (m_MyGarage.VehicleCollection.ContainsKey(m_LicenseNumber))
            {
                Console.WriteLine("FuelAuto exist in Garraje && in repairing !!!!");
                m_MyGarage.VehicleCollection[m_LicenseNumber].EVecihleStates = eVecihleState.Repairing;
            }
            else
            {
                OwnerData fuelBikeOwner = new OwnerData(m_ClientName, m_TelefonNumber,
                                                        new FuelMotorcicle(m_WheelManufacturer, m_CurrentPressure, m_ModelCar, m_LicenseNumber, currentAmountFuel,
                                                                           engineCapacityFuelBike, fuelBikeLicense));
                m_MyGarage.AddVehicleToGarrage(m_LicenseNumber, fuelBikeOwner);
            }
        }
コード例 #12
0
        private void DoPopup()
        {
            if (FOnPopupItem != null)
            {
                FOnPopupItem(this, null);
            }

            POINT vPt = OwnerData.GetScreenCoord(FButtonDrawRect.Left - (this.Width - FButtonDrawRect.Width),
                                                 FButtonDrawRect.Bottom + 1);

            //DoItemsChange(this);

            FPopupForm.Popup(vPt.X, vPt.Y);
        }
コード例 #13
0
ファイル: HCRadioGroup.cs プロジェクト: ols3er/HCView-CSharp
        public override bool MouseDown(MouseEventArgs e)
        {
            bool vResult = base.MouseDown(e);

            if (OwnerData.CanEdit() && (e.Button == MouseButtons.Left))
            {
                int vIndex = GetItemAt(e.X, e.Y);
                if (vIndex >= 0)
                {
                    DoSetItemChecked(vIndex, !this.FItems[vIndex].Checked);
                }
            }

            return(vResult);
        }
コード例 #14
0
        public int  ThirdOptionMenu()
        {
            Console.WriteLine("Please, type license number of desired vehicle");
            m_DesiredData = null;
            string       ownerName                    = null;
            string       ownerTelefon                 = null;
            string       vehicleState                 = null;
            string       licenseOfDesiredVehicle      = null;
            string       modelNameOfdesiredVehicle    = null;
            List <Wheel> wheelsOfDesiredVehicle       = null;
            string       vehicleEnergyState           = null;
            string       vehicleDataRepresentation    = null;
            int          vehicleDoesNotExistInGarraje = 0;

            string licenseNumOfDesiredVehicle = Console.ReadLine();

            m_DesiredData = m_MyGarage.getOwnerDataFromGarage(licenseNumOfDesiredVehicle);
            try
            {
                ownerName                 = m_DesiredData.getOwnersName();
                ownerTelefon              = Convert.ToString(m_DesiredData.getTelefonNumber());
                vehicleState              = m_DesiredData.EVecihleStates.ToString();
                licenseOfDesiredVehicle   = m_DesiredData.GetVecihle.GetLicencePlate;
                modelNameOfdesiredVehicle = m_DesiredData.GetVecihle.GetModelName;
                wheelsOfDesiredVehicle    = m_DesiredData.GetVecihle.getWheels;
                vehicleEnergyState        = m_DesiredData.GetVecihle.getEnergyState.ToString();
                vehicleDataRepresentation = string.Format(
                    @"Vehicle data of vehicle that number of his license is {0}:
Name of model           :   {1}
Name of owner           :   {2}
Telefon of owner        :   {3} 
Vehicle state           :   {4}
Energy state            :   {5}
Data about the wheels   :   ", licenseOfDesiredVehicle, modelNameOfdesiredVehicle, ownerName, ownerTelefon, vehicleState, vehicleEnergyState);
                Console.WriteLine(vehicleDataRepresentation);
                wheelsOfDesiredVehicle.ForEach(DisplayWheelData);
                GetVehicle(m_DesiredData.GetVecihle);
            }
            catch (Exception i_error)
            {
                Console.WriteLine("License Number does not exist in Garrage", i_error.Data);
                vehicleDoesNotExistInGarraje = 1;
            }

            return(vehicleDoesNotExistInGarraje);
        }
コード例 #15
0
        public IActionResult Put(long id, [FromBody] OwnerData owner)
        {
            if (owner == null)
            {
                return(BadRequest("Owner is null."));
            }

            OwnerData ownerToUpdate = _dataRepository.Get(id);

            if (ownerToUpdate == null)
            {
                return(NotFound("The Owner record couldn't be found."));
            }

            _dataRepository.Update(ownerToUpdate, owner);
            return(NoContent());
        }
コード例 #16
0
        public void UpdateVehicalState(int i_newState, OwnerData i_desiredData)
        {
            switch (i_newState)
            {
            case 1:
                i_desiredData.EVecihleStates = eVecihleState.Repairing;
                break;

            case 2:
                i_desiredData.EVecihleStates = eVecihleState.Repaired;
                break;

            case 3:
                i_desiredData.EVecihleStates = eVecihleState.Paid;
                break;
            }
        }
コード例 #17
0
        public void TheChoiseOfUserIsAutomobile()
        {
            String ColorOfCar = String.Format(@"Please, type your color : 
1: Green
2: Black
3: Red
4: Silver");

            Console.WriteLine(ColorOfCar);
            eCarColor colorOfCar = (eCarColor)(Convert.ToInt32(Console.ReadLine()));

            Console.Clear();

            String CountOfDoors = String.Format(@"Please, type your countOfDoors : 
2: TwoDoors
3: TreeDoors
4: FourDoors
5: FiveDoors");

            Console.WriteLine(ColorOfCar);
            eCountOfDoors countOfDoors = (eCountOfDoors)(Convert.ToInt32(Console.ReadLine()));

            Console.Clear();

            Console.WriteLine("Please type your current fuel ");
            float currentAmountFuel = Convert.ToInt32(Console.ReadLine());

            Console.Clear();


            if (m_MyGarage.VehicleCollection.ContainsKey(m_LicenseNumber))
            {
                Console.WriteLine("Auto exist in Garraje && in repairing !!!!");
                m_MyGarage.VehicleCollection[m_LicenseNumber].EVecihleStates = eVecihleState.Repairing;
            }
            else
            {
                OwnerData AutomobileOwner = new OwnerData(m_ClientName, m_TelefonNumber,
                                                          new Automobile(m_WheelManufacturer, m_CurrentPressure, m_ModelCar, m_LicenseNumber,
                                                                         currentAmountFuel, colorOfCar, countOfDoors));

                m_MyGarage.AddVehicleToGarrage(m_LicenseNumber, AutomobileOwner);
            }
        }
コード例 #18
0
        public IActionResult Post([FromBody] JObject jObject)
        {
            OwnerData od = new OwnerData();

            od.OwnerName    = Convert.ToString(jObject.SelectToken("OwnerName"));
            od.OwnerEmail   = Convert.ToString(jObject.SelectToken("OwnerEmail"));
            od.OwnerContact = Convert.ToInt64(jObject.SelectToken("OwnerContact"));
            od.Ownerpass    = Convert.ToString(jObject.SelectToken("Ownerpass"));
            //if (owner  == null)
            //{
            //    return BadRequest("Owner is null.");
            //}

            _dataRepository.Add(od);
            return(CreatedAtRoute(
                       "Get",
                       new { Id = od.OwnerId },
                       od));
        }
コード例 #19
0
        public void TheChoiseOfUserIsTruck()
        {
            bool  dangerousTruck     = true;
            float truckMaximalWeight = 0;
            int   dangerousMAterials = 0;
            float currentAmountFuel  = 0;

            String DangerousMaterialQuestion = String.Format(@"Please type if the Truck have a dangreous materials
1) Yes
0) NO");

            Console.WriteLine(DangerousMaterialQuestion);
            dangerousMAterials = Convert.ToInt32(Console.ReadLine());
            Console.Clear();
            if (Convert.ToBoolean(dangerousMAterials))
            {
            }
            else
            {
                dangerousTruck = false;
            }

            Console.WriteLine("Please type what is the maximal weight for the truck");
            truckMaximalWeight = Convert.ToInt32(Console.ReadLine());
            Console.Clear();
            Console.WriteLine("Please type your current fuel ");
            currentAmountFuel = Convert.ToInt32(Console.ReadLine());
            Console.Clear();
            if (m_MyGarage.VehicleCollection.ContainsKey(m_LicenseNumber))
            {
                Console.WriteLine("Truck exist in Garraje && in repairing !!!!");
                m_MyGarage.VehicleCollection[m_LicenseNumber].EVecihleStates = eVecihleState.Repairing;
            }
            else
            {
                OwnerData truckOwner = new OwnerData(m_ClientName, m_TelefonNumber,
                                                     new FuelTruck(m_WheelManufacturer, m_CurrentPressure, m_ModelCar, m_LicenseNumber,
                                                                   currentAmountFuel, dangerousTruck, truckMaximalWeight));

                m_MyGarage.AddVehicleToGarrage(m_LicenseNumber, truckOwner);
            }
        }
コード例 #20
0
        public void TheChoiceOfUserIsElectricAutomobile()
        {
            float  currentEnergyCharge = 0;
            String ColorOfCar          = String.Format(@"Please, type your color : 
1: Green
2: Black
3: Red
4: Silver");

            Console.WriteLine(ColorOfCar);
            eCarColor colorOfCar = (eCarColor)(Convert.ToInt32(Console.ReadLine()));

            Console.Clear();

            String CountOfDoors = String.Format(@"Please, type your countOfDoors : 
2: TwoDoors
3: TreeDoors
4: FourDoors
5: FiveDoors");

            Console.WriteLine(ColorOfCar);
            eCountOfDoors countOfDoors = (eCountOfDoors)(Convert.ToInt32(Console.ReadLine()));

            Console.Clear();

            Console.WriteLine("Please type your current energy status in Hours , for example if you get 1/2 of hours type 0.5");
            float.TryParse(Console.ReadLine(), out currentEnergyCharge);
            Console.Clear();

            if (m_MyGarage.VehicleCollection.ContainsKey(m_LicenseNumber))
            {
                Console.WriteLine("Auto exist in Garraje && in repairing !!!!");
                m_MyGarage.VehicleCollection[m_LicenseNumber].EVecihleStates = eVecihleState.Repairing;
            }
            else
            {
                OwnerData ElectricAutomobileOwner = new OwnerData(m_ClientName, m_TelefonNumber,
                                                                  new ElectricAutomobile(m_WheelManufacturer, m_CurrentPressure, m_ModelCar, m_LicenseNumber,
                                                                                         currentEnergyCharge, colorOfCar, countOfDoors));
                m_MyGarage.AddVehicleToGarrage(m_LicenseNumber, ElectricAutomobileOwner);
            }
        }
コード例 #21
0
        public override bool MouseUp(MouseEventArgs e)
        {
            if (OwnerData.CanEdit() && !OwnerData.Style.UpdateInfo.Selecting)
            {
                if (FItemHit)
                {
                    OwnerData.Style.ApplyTempStyle(TextStyleNo);
                    SIZE vSize = OwnerData.Style.TempCanvas.TextExtent(FText);
                    if (HC.PtInRect(HC.Bounds(FPaddingLeft, 0, FPaddingLeft + CheckBoxSize + FPaddingLeft + vSize.cx, vSize.cy), e.X, e.Y))
                    {
                        DoSetChecked(!FChecked);
                    }
                }
                else
                if (HC.PtInRect(GetBoxRect(), e.X, e.Y))  // 点在了勾选框中
                {
                    DoSetChecked(!FChecked);
                }
            }

            return(base.MouseUp(e));
        }
コード例 #22
0
        public override GameObject CreateGameObject(ReferenceData referenceData, Transform parent = null)
        {
            var gameObject = base.CreateGameObject(referenceData, parent);

            // Some weapons have a skinned mesh such as bows and crossbows, so make sure these have visible collision meshes.
            var skinnedMeshRenderers = gameObject.GetComponentsInChildren <SkinnedMeshRenderer>();

            foreach (var skinnedMeshRenderer in skinnedMeshRenderers)
            {
                var meshCollider = gameObject.AddComponent <MeshCollider>();
                meshCollider.sharedMesh = skinnedMeshRenderer.sharedMesh;
            }

            var ownerData = new OwnerData(referenceData.Owner, referenceData.Global, referenceData.Faction, referenceData.Rank);

            var health = referenceData.Health == -1 ? data.MaxHealth : referenceData.Health;
            var charge = referenceData.Charge == -1 ? data.enchantPts : referenceData.Charge;

            Weapon.Create(gameObject, this, referenceData);

            return(gameObject);
        }
コード例 #23
0
ファイル: HCRectItem.cs プロジェクト: ols3er/HCView-CSharp
 protected virtual void DoChange()
 {
     OwnerData.Change();
 }
コード例 #24
0
 protected bool GetAllowResize()
 {
     return(FCanResize && OwnerData.CanEdit());
 }
コード例 #25
0
ファイル: PersonalLogger.cs プロジェクト: touky/Prateek
 ///-------------------------------------------------------------
 public void Copy(OwnerData other)
 {
     Owner0 = other.Owner0;
     Owner1 = other.Owner1;
     Owner2 = other.Owner2;
 }
コード例 #26
0
 public HomeController(IConfiguration configuration, OwnerData ownerData)
 {
     this.configuration = configuration;
     this.ownerData     = ownerData;
 }