void SetupSlot(PlayerType playerType) { var slotController = EditContext.instance.Controller.GetSlotController(playerType); slotController.RemoveAll(); var komaTypeArray = Enum.GetValues(typeof(KomaType)).Cast <KomaType>(); foreach (var komaType in komaTypeArray) { if (komaType == KomaType.None) { continue; } var initData = new Koma.InitData(); initData.Type = komaType; initData.Lv = 1; initData.PlayerType = playerType; var newKoma = EditContext.instance.Controller.KomaFactory.Create(initData); slotController.Add(newKoma); } slotController.OnSelect = (koma) => { var otherSlotContrller = EditContext.instance.Controller.GetOtherSlotController(playerType); otherSlotContrller.ResetSelect(); this.komaType = koma.Type; this.playerType = koma.PlayerType; }; }
public Place(Koma.InitData data, PlayerType playerType) { Position = data.InitPosition; KomaType = data.Type; Lv = data.Lv; PlayerType = playerType; }
public InitData(PlaceData.Edit.Place place) { Type = place.KomaType; InitPosition = place.Position; Lv = place.Lv; PlayerType = place.PlayerType; }
public BoardPositions GetMovableBoardPositions( KomaType koma, PlayerType player, Board board, BoardPositions playerKomaPositions, BoardPositions opponentPlayerKomaPositions) { // [手駒なら空き位置のどこでも置ける] var positions = board.Positions; positions = positions.Substract(playerKomaPositions); positions = positions.Substract(opponentPlayerKomaPositions); return(positions); }
public BoardPositions GetMovableBoardPositions( KomaType komaType, PlayerType player, Board board, BoardPositions playerKomaPositions, BoardPositions opponentPlayerKomaPositions) { return(komaType.GetMovableBoardPositions( player, Position, IsTransformed, board, playerKomaPositions, opponentPlayerKomaPositions)); }
public Sprite Load(KomaType type) { string fileName = null; switch (type) { case KomaType.Type001: fileName = "sgl01"; break; case KomaType.Type002: fileName = "sgl02"; break; default: Debug.LogError($"【KomaIconLoader】未実装です。type={type}"); break; } return Load(fileName); }
public int GetMaxLv(KomaType type) { return(Data.Count(data => data.KomaType == type)); }
public KomaData Find(KomaType type, int lv = 1) { return(Data.First(data => data.KomaType == type && data.Lv == lv)); }
public Koma FindHandKoma(PlayerType player, KomaType komaType) { return(KomaList.FirstOrDefault(x => x.Player == player && x.IsInHand && x.KomaType == komaType)); }
public HandKomaMoveCommand(PlayerType player, BoardPosition toPosition, KomaType komaType) : base(player, toPosition) { KomaType = komaType; }