public Character GetCharacter(PanelEntity target) { var panel = _stageModel.GetPanel(target); if (panel.GetCharacterId() == -1) { return(null); } var character = _residueCharacter.GetCharacter(panel.GetCharacterId()); return(character ?? _residueEnemy.GetCharacter(panel.GetCharacterId())); }
public void EmitPanel(PanelEntity entity) { if (_load.Contains(entity)) { foreach (var load in _load.Reverse()) { if (load == entity) { break; } _load.Remove(load); } } else { _load.Add(entity); } }
public DiceStageView Create(PanelEntity entity) { var random = new Random(); var result = Enum.GetValues(typeof(DiceType)) .Cast <DiceType>() .OrderBy(c => random.Next()) .FirstOrDefault(); switch (result) { case DiceType.D3: return(_diceStageD3.Create(entity)); case DiceType.D6: return(_diceStageD6.Create(entity)); case DiceType.D8: return(_diceStageD8.Create(entity)); default: throw new ArgumentOutOfRangeException(); } }
public void EmitFirst(PanelEntity entity) { _load.Clear(); _load.Add(entity); }
// キャラクターの離脱 public void Escaped(PanelEntity target) { _stage[_stageHash[target.X][target.Y]].Escaped(); }
// キャラクターの進入 public void Invaded(Character character, PanelEntity target) { _stage[_stageHash[target.X][target.Y]].Invaded(character); }
// キャラクター移動完了 最終地点更新 public void ModeEnd(PanelEntity panelEntity) { _moveEndPanel.OnNext(panelEntity); }
public PanelModel GetPanel(PanelEntity target) { return(_stage[_stageHash[target.X][target.Y]]); }
// 移動可能判定 public bool Invasive(PanelEntity target) { return(_stage[_stageHash[target.X][target.Y]].Invasive()); }
// 移動可能判定 public bool Invasive(PanelEntity target) { return(_stageModel.Invasive(target)); }
private void Escaped(PanelEntity target) { _stageModel.Escaped(target); }
private void Invaded(Character character, PanelEntity target) { _stageModel.Invaded(character, target); }
public PanelModel(int x, int y, int state, int id) { _entity = new PanelEntity(x, y, state); _isTarget = new ReactiveProperty <bool>(false); _characterId = id; }