public IFigureItem InstantiateItem()
        {
            int            possibleFigureTypesCount = System.Enum.GetNames(typeof(FigureItemType)).Length - 2; //minus empty and no_access
            FigureItemType figureItemType           = (FigureItemType)randomizer.Next(0, possibleFigureTypesCount);

            IFigureItemsFactory figureItemsFactory = new FigureItemsFactory();

            return(figureItemsFactory.CreateFigureItem(figureItemType));
        }
Пример #2
0
 public void KillIfOnBoard()
 {
     if (Location == FigureLocation.board)
     {
         IsInAction = true;
         Location   = FigureLocation.cemetery;
         figureType = FigureItemType.empty;
         animator.SetTrigger(_preload.Kill_hash);
     }
 }
Пример #3
0
        public void InitItem(int x_position, int y_position, FigureItemType type, FigureLocation location)
        {
            if (wasInited)
            {
                return;
            }

            Position   = new Vector2Int(x_position, y_position);
            FigureType = type;
            Location   = location;

            wasInited = true;
        }
Пример #4
0
 public FigureItem(FigureItemType figureItemType)
 {
     FigureType = figureItemType;
 }
Пример #5
0
 public void SetEmpty()
 {
     FigureType = FigureItemType.empty;
 }
Пример #6
0
 public IFigureItem CreateFigureItem(FigureItemType figureItemType)
 {
     return(new FigureItem(figureItemType));
 }