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)); }
public void KillIfOnBoard() { if (Location == FigureLocation.board) { IsInAction = true; Location = FigureLocation.cemetery; figureType = FigureItemType.empty; animator.SetTrigger(_preload.Kill_hash); } }
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; }
public FigureItem(FigureItemType figureItemType) { FigureType = figureItemType; }
public void SetEmpty() { FigureType = FigureItemType.empty; }
public IFigureItem CreateFigureItem(FigureItemType figureItemType) { return(new FigureItem(figureItemType)); }