예제 #1
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            FactoryObject.SetManager();
            string kullaniciAdi = tbxKullaniciAdi.Text;
            string password     = tbxPassword.Text;

            if (!string.IsNullOrEmpty(kullaniciAdi) && !string.IsNullOrEmpty(password))
            {
                foreach (var item in FactoryObject.Managers)
                {
                    if (kullaniciAdi == item.UserName && password == item.Password)
                    {
                        FactoryObject.SetAllFile();
                        MainPage mainPage = new MainPage(this);

                        this.Hide();
                        mainPage.Show();
                        break;
                    }
                }
            }
            else
            {
                MessageBox.Show("Bos geçmeyiniz");
            }
        }
예제 #2
0
        public override void Setup(GridObject gridObject, Direction dir, FactoryNeighbors customNeighbors = null)
        {
            base.Setup(gridObject, dir, customNeighbors);
            FactoryObject outputNeighbor = Neighbors.GetSide(OutputDirection);

            if (outputNeighbor != null)
            {
                FactoryBelt belt = outputNeighbor.GetComponent <FactoryBelt>();
                if (belt != null)
                {
                    _output = new BeltConnection(belt);
                }
                //FactoryAssembler assembler = outputNeighbor.GetComponent<FactoryAssembler>();
                //if (assembler != null) _output = new AssemblerConnection(assembler);
            }
            FactoryObject inputNeighbor = Neighbors.GetSide(InputDirection);

            if (inputNeighbor != null)
            {
                FactoryBelt belt = inputNeighbor.GetComponent <FactoryBelt>();
                if (belt != null)
                {
                    _input = new BeltConnection(belt);
                }
                FactoryCreativeOutput creativeOutput = inputNeighbor.GetComponent <FactoryCreativeOutput>();
                if (creativeOutput != null)
                {
                    _input = new CreativeOutputConnection(creativeOutput);
                }
                //FactoryAssembler assembler = inputNeighbor.GetComponent<FactoryAssembler>();
                //if (assembler != null) _input = new AssemblerConnection(assembler);
            }
        }
예제 #3
0
 private void UrunGetir()
 {
     FactoryObject.SetProduct();
     foreach (var item in FactoryObject.Products)
     {
         lbProduct.Items.Add(item.ProductName);
     }
 }
예제 #4
0
 public void DisableFactoryPlacement()
 {
     SelectedFactory = null;
     Active          = false;
     if (PreviewPlacement != null)
     {
         PreviewPlacement.SetActive(false);
     }
 }
 private void KategoriGetir()
 {
     lbCategory.Items.Clear();
     FactoryObject.SetCategory();
     foreach (var item in FactoryObject.Categories)
     {
         lbCategory.Items.Add(item.CategoryName);
     }
 }
예제 #6
0
 public void SetFactory(FactoryObject factoryObject)
 {
     SelectedFactory = factoryObject;
     Active          = true;
     if (PreviewPlacement == null)
     {
         CreateNewPreview();
     }
     PreviewPlacement.SetActive(true);
 }
        public void SetFactoryObject(FactoryObject obj)
        {
            FactoryCreativeOutput creativeOutput = obj.GetComponent <FactoryCreativeOutput>();

            if (creativeOutput != null)
            {
                _creativeOutputMenu.gameObject.SetActive(true);
                _creativeOutputMenu.Setup(creativeOutput);
            }
        }
예제 #8
0
        public AnaSayfa()
        {
            InitializeComponent();
            SetProperty();


            FileHelper.LoadFile();
            FactoryObject.SetAllFile();
            gBInfo.Hide();
        }
예제 #9
0
        public void ShouldInsertWhenObjectRepositoryIsValid()
        {
            Object entity = FactoryObject.RandomCreate();

            _spacePlanningUnitOfWork.ObjectRepository.Add(entity);
            _spacePlanningUnitOfWork.Save();
            var retrived = _spacePlanningUnitOfWork.ObjectRepository.GetById(entity.ObjectId);

            Assert.IsTrue(retrived.Equals(entity));
        }
예제 #10
0
        public ProductSearchFrm()
        {
            InitializeComponent();
            SetProperty();


            FileHelper.LoadFile();
            FactoryObject.SetAllFile();
            gBInfo.Hide();
        }
예제 #11
0
        public void ShouldDeleteWhenObjectRepositoryIsValid()
        {
            Object entity = FactoryObject.RandomCreate();

            _spacePlanningUnitOfWork.ObjectRepository.Add(entity);
            _spacePlanningUnitOfWork.Save();

            _spacePlanningUnitOfWork.ObjectRepository.Delete(entity);
            _spacePlanningUnitOfWork.Save();
            var retrived = _spacePlanningUnitOfWork.ObjectRepository.GetById(entity.ObjectId);

            Assert.IsNull(retrived);
        }
        private void AddObject(Position pos, Direction dir, FactoryObject factoryObject, bool instantiate = true, FactoryNeighbors customNeighbors = null)
        {
            if (_grid.ContainsKey(pos))
            {
                return;
            }

            GridObject gridObject = new GameObject("Object(" + pos.X + "," + pos.Y + ")").AddComponent <GridObject>();

            gridObject.transform.SetParent(transform);
            gridObject.transform.localPosition = pos.GetLocalPosition();

            gridObject.NorthNeighbor = FindNeighbor(pos, Direction.North);
            gridObject.EastNeighbor  = FindNeighbor(pos, Direction.East);
            gridObject.SouthNeighbor = FindNeighbor(pos, Direction.South);
            gridObject.WestNeighbor  = FindNeighbor(pos, Direction.West);
            if (gridObject.NorthNeighbor != null)
            {
                gridObject.NorthNeighbor.SouthNeighbor = gridObject;
            }
            if (gridObject.EastNeighbor != null)
            {
                gridObject.EastNeighbor.WestNeighbor = gridObject;
            }
            if (gridObject.SouthNeighbor != null)
            {
                gridObject.SouthNeighbor.NorthNeighbor = gridObject;
            }
            if (gridObject.WestNeighbor != null)
            {
                gridObject.WestNeighbor.EastNeighbor = gridObject;
            }

            if (instantiate)
            {
                gridObject.FactoryObject = Instantiate(factoryObject, gridObject.transform).GetComponent <FactoryObject>();
                gridObject.FactoryObject.Setup(gridObject, dir, customNeighbors);
            }
            else
            {
                gridObject.FactoryObject = factoryObject;
            }
            if (gridObject.FactoryObject != null)
            {
                gridObject.FactoryObject.ConnectedObjects.Add(gridObject);
            }

            gridObject.Chunk         = this;
            gridObject.ChunkPosition = pos;
            _grid.Add(pos, gridObject);
        }
예제 #13
0
    public GenericHero(Vector3 position)
    {
        GameObject = Factory.CreateInstance <T>(position, Quaternion.identity);
        FactoryObject factoryObject = Factory.FetchWeaponDataOfType <T>();

        if (factoryObject is FactoryObject_Character characterData)
        {
            WeaponData = characterData.WeaponData;
        }
        weapon    = Factory.CreateInstance <IWeapon>(WeaponData.FetchType(WeaponData.WeaponType), WeaponData);
        Transform = GameObject.transform;
        IsAlive   = false;
        Animator  = GameObject.GetComponent <Animator>();
    }
예제 #14
0
 public GameObject GrabUnusedFactoryObject()
 {
     foreach (GameObject go in m_pooledFactoryObjects)
     {
         FactoryObject fObj = go.GetComponent <FactoryObject>();
         // If our GameObject has a FactoryObject Component and is not in use then return it
         if (fObj && !fObj.IsInUse)
         {
             return(go);
         }
     }
     // All objects are in use, return null
     return(null);
 }
    public FactoryObject GetFactoryObject(Type type)
    {
        FactoryObject returnedObject = null;

        if (type is Car)
        {
            returnedObject = new Car();
        }
        elseif(type is Bicycle) returnedObject = new Bicycle();
        if (returnedObject != null)
        {
            returnedObject.Create();
        }
        return(returnedObject);
    }
        public void PlaceObject(GridPlacement placementData, Vector3 worldPos)
        {
            int size = placementData.SelectedFactory.GridSize;

            if (size == 1)
            {
                AddObject(WorldToChunkGrid(worldPos.x, worldPos.y), placementData.Direction, placementData.SelectedFactory);
            }
            else if (size == 3)
            {
                Position  basePos = WorldToChunkGrid(worldPos.x, worldPos.y);
                Direction dir     = placementData.Direction;

                GridObject north;
                Position   pos = basePos.GetRelativePosition(0, 2);
                if (pos.Y > Height && NorthNeighbor != null)
                {
                    pos   = pos.GetRelativePosition(0, -Height);
                    north = NorthNeighbor._grid.ContainsKey(pos) ? NorthNeighbor._grid[pos] : null;
                }
                else
                {
                    north = _grid.ContainsKey(pos) ? _grid[pos] : null;
                }
                pos = basePos.GetRelativePosition(2, 0);
                GridObject east = _grid.ContainsKey(pos) ? _grid[pos] : null;
                pos = basePos.GetRelativePosition(0, -2);
                GridObject south = _grid.ContainsKey(pos) ? _grid[pos] : null;
                pos = basePos.GetRelativePosition(-2, 0);
                GridObject west = _grid.ContainsKey(pos) ? _grid[pos] : null;
                AddObject(basePos, dir, placementData.SelectedFactory, true, new FactoryNeighbors(north, east, south, west, dir));
                FactoryObject factoryObject = _grid[basePos].FactoryObject;

                AddObject(basePos.GetRelativePosition(0, 1), dir, factoryObject, false);
                AddObject(basePos.GetRelativePosition(1, 1), dir, null, false);
                AddObject(basePos.GetRelativePosition(1, 0), dir, factoryObject, false);
                AddObject(basePos.GetRelativePosition(1, -1), dir, null, false);
                AddObject(basePos.GetRelativePosition(0, -1), dir, factoryObject, false);
                AddObject(basePos.GetRelativePosition(-1, -1), dir, null, false);
                AddObject(basePos.GetRelativePosition(-1, 0), dir, factoryObject, false);
                AddObject(basePos.GetRelativePosition(-1, 1), dir, null, false);

                //List<GridObject> northNeighbors = new List<GridObject> {_grid[basePos.GetRelativePosition(-1, 2)], _grid[basePos.GetRelativePosition(0, 2)], _grid[basePos.GetRelativePosition(1, 2)]};
                //List<GridObject> eastNeighbors = new List<GridObject> {_grid[basePos.GetRelativePosition(2, -1)], _grid[basePos.GetRelativePosition(2, 0)], _grid[basePos.GetRelativePosition(2, 1)]};
                //List<GridObject> southNeighbors = new List<GridObject> {_grid[basePos.GetRelativePosition(-1, -2)], _grid[basePos.GetRelativePosition(0, -2)], _grid[basePos.GetRelativePosition(1, -2)]};
                //List<GridObject> westNeighbors = new List<GridObject> {_grid[basePos.GetRelativePosition(-2, -1)], _grid[basePos.GetRelativePosition(-2, 0)], _grid[basePos.GetRelativePosition(-2, 1)]};
            }
        }
        public override void Setup(GridObject gridObject, Direction dir, FactoryNeighbors customNeighbors = null)
        {
            base.Setup(gridObject, dir, customNeighbors);
            FactoryObject northFactory = Neighbors.GetNeighbor(Direction.North);

            if (northFactory != null)
            {
                FactoryBelt belt = northFactory.GetComponent <FactoryBelt>();
                if (belt != null && belt.Dir == Direction.North)
                {
                    AddBelt(belt, Dir == Direction.North);
                }
            }
            FactoryObject eastFactory = Neighbors.GetNeighbor(Direction.East);

            if (eastFactory != null)
            {
                FactoryBelt belt = eastFactory.GetComponent <FactoryBelt>();
                if (belt != null && belt.Dir == Direction.East)
                {
                    AddBelt(belt, Dir == Direction.East);
                }
            }
            FactoryObject southFactory = Neighbors.GetNeighbor(Direction.South);

            if (southFactory != null)
            {
                FactoryBelt belt = southFactory.GetComponent <FactoryBelt>();
                if (belt != null && belt.Dir == Direction.South)
                {
                    AddBelt(belt, Dir == Direction.South);
                }
            }
            FactoryObject westFactory = Neighbors.GetNeighbor(Direction.West);

            if (westFactory != null)
            {
                FactoryBelt belt = westFactory.GetComponent <FactoryBelt>();
                if (belt != null && belt.Dir == Direction.West)
                {
                    AddBelt(belt, Dir == Direction.West);
                }
            }
        }
예제 #18
0
        public static IAccount CreateObject(FactoryObject factoryObject)
        {
            IAccount objIAccount = null;

            switch (factoryObject)
            {
            case FactoryObject.SavingAccount:
                objIAccount = new SavingsAccount();
                break;

            case FactoryObject.CheckingAccount:
                objIAccount = new CheckingAccount();
                break;

            default:
                break;
            }

            return(objIAccount);
        }
예제 #19
0
        void MessageFun(string messageKey, object param1, object param2)
        {
            if (messageKey.CompareTo(Hi5_Glove_Interaction_Message.Hi5_MessageMessageKey.messageObjectEvent) == 0)
            {
                Hi5_Glove_Interaction_Object_Event_Data data = param1 as Hi5_Glove_Interaction_Object_Event_Data;
                if (data.mObjectId == ObjectItem.idObject)
                {
                    switch (data.mEventType)
                    {
                    case EEventObjectType.EClap:
                        break;

                    case EEventObjectType.EPoke:
                        break;

                    case EEventObjectType.EPinch:
                        FactoryObject    fObj = gameObject.GetComponent <FactoryObject>();
                        FactoryContainer fCon = gameObject.GetComponent <FactoryContainer>();
                        if (fObj)
                        {
                            fObj.CanMove = false;
                        }
                        if (fCon)
                        {
                            fCon.CanMove     = false;
                            fCon.TimerActive = false;
                        }
                        break;

                    case EEventObjectType.EMove:
                        break;

                    case EEventObjectType.ELift:
                        break;

                    case EEventObjectType.EStatic:
                        break;
                    }
                }
            }
        }
        /**
         * Add a loaded ITagProcessor.
         *
         * @param tag the tag the processor with the given className maps to
         * @param processor the ITagProcessor
         */
        virtual public void AddProcessor(String tag, ITagProcessor processor) {
            map[tag] = new FactoryObject(processor.GetType().FullName, processor, this);

        }
 /**
  * Add an unloaded ITagProcessor.
  *
  * @param tag the tag the processor with the given className maps to
  * @param className the fully qualified class name (class has to be found on classpath, will be loaded with Class.ForName()
  */
 virtual public void AddProcessor(String tag, String className) {
     map[tag] = new FactoryObject(className, this);
 }
 /**
  * Add a loaded ITagProcessor.
  *
  * @param tag the tag the processor with the given className maps to
  * @param processor the ITagProcessor
  */
 public void AddProcessor(String tag, ITagProcessor processor)
 {
     map[tag] = new FactoryObject(processor.GetType().FullName, processor, this);
 }
 /**
  * Add an unloaded ITagProcessor.
  *
  * @param tag the tag the processor with the given className maps to
  * @param className the fully qualified class name (class has to be found on classpath, will be loaded with Class.ForName()
  */
 public void AddProcessor(String tag, String className)
 {
     map[tag] = new FactoryObject(className, this);
 }
 public static void RegisterType(FactoryObject obj)
 {
     knownObjects.Add(obj);
 }