예제 #1
0
 public LotController(UserManager <User> userManager, IUser iUser, ILot iLot, IPurchase iPurchase)
 {
     _user        = iUser;
     _lot         = iLot;
     _userManager = userManager;
     _purchase    = iPurchase;
 }
예제 #2
0
 public AnswerFabric(IStatus status, IReplicStorage rs, ILot Lot)
 {
     checker = status;
     replics = rs;
     lot     = Lot;
     //_dPart = DialogPart.noDial;
 }
예제 #3
0
 public BaseLot(ILot lot)
     : base(lot)
 {
     AuctionPeriod = lot.AuctionPeriod;
     AuctionUrl    = lot.AuctionUrl;
     Status        = lot.Status;
 }
 public AnswerGenerator(IDBProcCaller caller, ILot lotMaker, ILunch lunchMaker)
 {
     procCaller = caller;
     lot        = lotMaker;
     lunch      = lunchMaker;
     category   = SkillCategory.no;
 }
예제 #5
0
파일: Program.cs 프로젝트: kflu/puzzles
 public void Checkin(VehicleSize vehicleSize, ILot lot)
 {
     Lot _lot = lot as Lot;
     if (_lot == null) throw new ArgumentException("lot is not of vehicleSize Lot");
     int cost = (int)vehicleSize;
     Lots[_lot.Saturation].Remove(_lot);
     _lot.Saturation -= cost;
     Lots[_lot.Saturation].Add(_lot);
 }
예제 #6
0
 public void AddLot(ILot lot)
 {
     lock (LotList)
     {
         if (lot != null)
         {
             this.LotList.Add(lot);
         }
     }
 }
예제 #7
0
        public static MicronBEAssyPlanInfo CreatePlanInfo(ILot lot, Mozart.SeePlan.DataModel.Step task)
        {
            MicronBEAssyPlanInfo plan  = new MicronBEAssyPlanInfo();
            MicronBEAssyBELot    beLot = lot as MicronBEAssyBELot;

            plan.Init(task);
            plan.LotID     = lot.LotID;
            plan.UnitQty   = lot.UnitQty;
            plan.ProductID = beLot.Product.ProductID;
            plan.ProcessID = beLot.Process.ProcessID;

            return(plan);
        }
예제 #8
0
        private bool canBuildRandomStreet(ILot[,] grid, int x, int z)
        {
            if (x <= 0 || x >= grid.GetLength(0) - 1 || z <= 0 || z >= grid.GetLength(1) - 1)
            {
                return(false);
            }

            ILot[] lots = new ILot[] { grid[x + 1, z + 1], grid[x - 1, z + 1] };
            foreach (ILot lot in lots)
            {
                if (lot != null && lot.lotType == LotType.Street)
                {
                    return(false);
                }
            }
            return(true);
        }
예제 #9
0
파일: Program.cs 프로젝트: kflu/puzzles
        public bool TryCheckout(VehicleSize vehicleSize, out ILot lot)
        {
            int cost = (int)vehicleSize;
            foreach (int saturationIndex in new int[] { 1, 0 })
            {
                if (2 - saturationIndex < cost || Lots[saturationIndex].Count == 0) continue;
                Lot _lot = Lots[saturationIndex].First();
                _lot.Saturation += cost;
                Lots[saturationIndex].Remove(_lot);
                Lots[_lot.Saturation].Add(_lot);
                lot = _lot;
                return true;
            }

            lot = null;
            return false;
        }
예제 #10
0
        /// <summary>Be sure that the index you are sending is of a valid LOT!</summary>
        private void GenerateApple(ILot[,] lots, int x, int z, List <Lot> apple)
        {
            Lot thisLot = (Lot)lots[x, z];

            apple.Add(thisLot);

            for (int i = 0; i < 2; i++)
            {
                Vector2 lotIndex = new Vector2(i == 0 ? x + 1 : x, z + i);
                if (lots.GetLength(0) > lotIndex.x && lots.GetLength(1) > lotIndex.y)
                {
                    ILot neighboor = lots[(int)lotIndex.x, (int)lotIndex.y];
                    if (neighboor.lotType == LotType.Lot && ((Lot)neighboor).neighboor == null)
                    {
                        ((Lot)neighboor).neighboor = thisLot;
                        GenerateApple(lots, (int)lotIndex.x, (int)lotIndex.y, apple);
                    }
                }
            }
        }
예제 #11
0
        /*
         * 26/10/17: Por si nos sirve para el input.
         *
         * public void Input_Generate()
         * {
         *  Destroy(container);
         *  container = null;
         *  GC.Collect();
         *  GenerateMap();
         * }
         *
         * public void Input_Draw()
         * {
         *  DrawNeighboor();
         * }
         *
         * public void Input_SetActive()
         * {
         *  container.SetActive(!container.activeSelf);
         * }
         */

        private void DrawNeighboor()
        {
            for (int x = 0; x < map.GetLength(0); x++)
            {
                for (int z = 0; z < map.GetLength(1); z++)
                {
                    ILot ilot = map[x, z];
                    if (ilot.lotType == LotType.Lot)
                    {
                        Lot lot = ((Lot)ilot);
                        if (lot.neighboor != null)
                        {
                            Vector3 thisPos      = lot.worldPos;
                            Vector3 neighboorPos = ((Lot)lot).neighboor.worldPos;
                            Debug.DrawLine(thisPos, neighboorPos, Color.red);
                        }
                    }
                }
            }
        }
예제 #12
0
        /// <summary>
        /// </summary>
        /// <param name="lot"/>
        /// <param name="task"/>
        /// <param name="handled"/>
        /// <param name="prevReturnValue"/>
        /// <returns/>
        public LoadInfo CREATE_LOAD_INFO0(ILot lot, Step task, ref bool handled, LoadInfo prevReturnValue)
        {
            try
            {
                MicronBEAssyPlanInfo plan = new MicronBEAssyPlanInfo();

                MicronBEAssyBELot beLot = lot as MicronBEAssyBELot;

                plan.Init(task);
                plan.LotID     = lot.LotID;
                plan.UnitQty   = lot.UnitQty;
                plan.ProductID = beLot.Product.ProductID;
                plan.ProcessID = beLot.Process.ProcessID;

                return(plan);
            }
            catch (Exception e)
            {
                WriteHelper.WriteErrorHistory(ErrorLevel.FATAL, string.Format("ErrorMessage : {0}   MethodName : {1}", e.Message, System.Reflection.MethodInfo.GetCurrentMethod().Name));
                return(default(LoadInfo));
            }
        }
예제 #13
0
 private void InstantiateGridElements(ILot[,] lots)
 {
     container.transform.position = Vector3.zero;
     for (int x = 0; x < lots.GetLength(0); x++)
     {
         for (int z = 0; z < lots.GetLength(1); z++)
         {
             ILot       lot = lots[x, z];
             GameObject lotGo;
             if (lot.lotType == LotType.Street)
             {
                 lotGo = Instantiate(lot.buildings[0], lot.worldPos, lot.buildings[0].transform.rotation);
             }
             else
             {
                 lotGo = Instantiate(lot.buildings[Random.Range(0, lot.buildings.Length - 1)],
                                     lot.worldPos, Quaternion.identity);
             }
             lotGo.transform.SetParent(container.transform);
         }
     }
 }
예제 #14
0
        private ILot[,] GenerateGrid()
        {
            ILot[,] grid = new ILot[mapWidth, mapHeight];

            // build streets
            int x = 0;

            for (int n = 0; n < 50; n++)
            {
                for (int h = 0; h < mapHeight; h++)
                {
                    grid[x, h] = new Street(zStreets, new Vector2(x, h));
                }
                x += Random.Range(2, 15);
                if (x >= mapWidth)
                {
                    break;
                }
            }

            int z = 0;

            for (int n = 0; n < 10; n++)
            {
                for (int w = 0; w < mapWidth; w++)
                {
                    if (grid[w, z] != null && grid[w, z].lotType == LotType.Street)
                    {
                        grid[w, z] = new Street(crossRoad, new Vector2(w, z));
                    }
                    else
                    {
                        grid[w, z] = new Street(xStreets, new Vector2(w, z));
                    }
                }
                z += Random.Range(2, 20);
                if (z >= mapHeight)
                {
                    break;
                }
            }

            // get cross streets
            if (randomStreets)
            {
                for (x = 0; x < grid.GetLength(0); x++)
                {
                    for (z = 0; z < grid.GetLength(1); z++)
                    {
                        if ((grid[x, z] != null && grid[x, z].lotType == LotType.Street) &&
                            canBuildRandomStreet(grid, x, z) && Random.Range(0, 10) > 8)
                        {
                            while ((++z < grid.GetLength(1)) &&
                                   (grid[x, z] == null || grid[x, z].lotType != LotType.Street))
                            {
                                grid[x, z] = new Street(xStreets, new Vector2(x, z));
                            }
                        }
                    }
                }
            }

            // add buildings
            float perlinSeed = Random.Range(0f, 40f);

            for (int h = 0; h < mapHeight; h++)
            {
                for (int w = 0; w < mapWidth; w++)
                {
                    if (grid[w, h] == null || grid[w, h].lotType != LotType.Street)
                    {
                        float perlin = Mathf.PerlinNoise(w / 10f + perlinSeed, h / 10f + perlinSeed) * 10;
                        grid[w, h] = new Lot(new Vector2(w, h), GetNeighborhoodFromNoise(perlin));
                    }
                    grid[w, h].worldPos = new Vector3(w * buildingFootprint, 0, h * buildingFootprint);
                }
            }

            return(grid);
        }
예제 #15
0
 public Transaction(ILot owner, DateTime transactionDate, Int16 rowCount, Int16 columnCount, Int16 codeLength)
 {
     this._owner           = owner;
     this._transactionDate = transactionDate;
     this._verfication     = new CodeCard(this, rowCount, columnCount, codeLength);
 }
예제 #16
0
 public void addLot(ILot newLot)
 {
 }
예제 #17
0
 public LotDTO(ILot lot)
     : base(lot)
 {
 }
예제 #18
0
파일: Lot.cs 프로젝트: AqueGen/Prozorro
 public Lot(ILot lot)
     : base(lot)
 {
 }
예제 #19
0
        /// <summary>
        /// </summary>
        /// <param name="lot"/>
        /// <param name="handled"/>
        /// <param name="prevReturnValue"/>
        /// <returns/>
        public double GET_FORWARD_PEGGING_QTY0(ILot lot, ref bool handled, double prevReturnValue)
        {
            var slot = lot as FabLot;

            return(slot.UnitQty);
        }