private bool TryPut(int[] landscape, int index, out FigureInfo info) { var length = landscape.Length; var startIndex = GetStartIndex(length, index); var endIndex = GetEndIndex(length, index); for (; startIndex < endIndex + 1; startIndex++) { if (CanPut(startIndex, landscape)) { info = new FigureInfo() { turgetIndex = startIndex, rotate = Direction.Up, turningLosses = 0 }; return(true); } } info = new FigureInfo(); return(false); }
public async Task <IActionResult> GetFigureArea(long id) { var request = new GetFigureInfoRequest(id); FigureInfo figureInfo = await _mediator.Send(request); return(Content(figureInfo.Area.ToString(CultureInfo.InvariantCulture))); }
public async Task <IActionResult> GetFigure(long id) { var request = new GetFigureInfoRequest(id); FigureInfo figureInfo = await _mediator.Send(request); return(Ok(figureInfo)); }
public UnderRaycaster(ref PostureState posture, ref FigureInfo figure, _Action3Enemy act) { hookingReach = figure.groundHookReach; up = posture.rot * Vector3.up; bodypos = act.rb.position + up * figure.moveRadius; }
public virtual void CreateFigure(FigureInfo i) { ClearFigure(); items = new List <Item>(); info = i; transform.position = coordinates = info.coordinates; foreach (Vector3 crd in info.items) { AddItem(crd); } }
public ForwawrdAndUnderRaycaster(ref PostureState posture, ref FigureInfo figure, _Action3Enemy act) { r = new UnderRaycaster(ref posture, ref figure, act); movedist = act.stance.moveSpeed * GM.t.delta; moveRadius = figure.moveRadius; forward = posture.rot * Vector3.forward; forwardOrigin = posture.isGotFoothold ? r.bodypos : r.bodypos - forward; }
void Awake() { m_figureInfo = new FigureInfo(m_figureID); if (m_figureID == 9) { m_isEnteredInBlocks = false; m_isLeftBlocks = false; } CreateBlocks(m_figureInfo.m_blocksCount); m_positions = new List <Transform> (); m_positions.AddRange(gameObject.GetComponentsInChildren <Transform>()); m_positions.RemoveAt(0); m_rotationAxisBlock = m_positions [m_figureInfo.m_indexRotationAxisBlock]; m_sprites = new List <SpriteRenderer> (); m_sprites.AddRange(gameObject.GetComponentsInChildren <SpriteRenderer> ()); m_nextRotationState = 0; m_isHoldDown = false; }
/// <summary> /// 接地情報をメンバに取得する。 /// </summary> /// <param name="rb">キャラクターの Rigidbody</param> /// <param name="figure">身体情報</param> /// <returns>このオブジェクトのコピー</returns> public FootGroundUnit checkOnGround(Rigidbody rb, ref FigureInfo figure) { var hit = new RaycastHit(); var r = figure.moveRadius * 0.8f; var ray = new Ray(rb.position + Vector3.up * r, Vector3.down); isGround = Physics.SphereCast(ray, r, out hit, r + figure.groundHookReach, UserLayer.groundForPlayer); normal = isGround ? hit.normal : Vector3.up; // 接地してない場合は真上 groundCollider = hit.collider; return(this); }
// 初期化・基本処理 ========================================= //protected override void deepInit() new protected void Awake() { base.Awake(); figure = new FigureInfo(this); shoot = GetComponentInChildren <EnemyShoot3>(); if (shoot) { shoot.deepInit(this); } rb.solverIterations = 1; // }
public async Task <long> StoreAsync(IFigure figure) { if (figure == null) { throw new ArgumentNullException(nameof(figure)); } var info = new FigureInfo { Figure = figure }; await using var uow = new Db(); // ReSharper disable once MethodHasAsyncOverload - sync overload is preferred here as per docs uow.FigureInfos.Add(info); await uow.SaveChangesAsync().ConfigureAwait(false); return(info.Id); }
public override void CreateFigure(FigureInfo i) { ClearGoal(); base.CreateFigure(i); CreateGoal(); }
public bool isGoalOrLimit(ref FigureInfo figure, Vector3 position) { var bodySize = figure.moveCollider.radius * 2.0f; return(isLimitOver || isGoal(bodySize, position)); }