示例#1
0
        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;
            };
        }
示例#2
0
 public Place(Koma.InitData data, PlayerType playerType)
 {
     Position   = data.InitPosition;
     KomaType   = data.Type;
     Lv         = data.Lv;
     PlayerType = playerType;
 }
示例#3
0
 public InitData(PlaceData.Edit.Place place)
 {
     Type         = place.KomaType;
     InitPosition = place.Position;
     Lv           = place.Lv;
     PlayerType   = place.PlayerType;
 }
示例#4
0
        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);
        }
示例#5
0
 public BoardPositions GetMovableBoardPositions(
     KomaType komaType,
     PlayerType player,
     Board board,
     BoardPositions playerKomaPositions,
     BoardPositions opponentPlayerKomaPositions)
 {
     return(komaType.GetMovableBoardPositions(
                player,
                Position,
                IsTransformed,
                board,
                playerKomaPositions,
                opponentPlayerKomaPositions));
 }
示例#6
0
 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);
 }
示例#7
0
 public int GetMaxLv(KomaType type)
 {
     return(Data.Count(data => data.KomaType == type));
 }
示例#8
0
 public KomaData Find(KomaType type, int lv = 1)
 {
     return(Data.First(data => data.KomaType == type && data.Lv == lv));
 }
示例#9
0
 public Koma FindHandKoma(PlayerType player, KomaType komaType)
 {
     return(KomaList.FirstOrDefault(x => x.Player == player && x.IsInHand && x.KomaType == komaType));
 }
示例#10
0
 public HandKomaMoveCommand(PlayerType player, BoardPosition toPosition, KomaType komaType) : base(player, toPosition)
 {
     KomaType = komaType;
 }