private static CollisionData CheckWhichBrickWhichSide(List <MatrixCoords> movingObjectCoords, ICollection <IDestroyable> staticObjects) { HitTypeEnum side = HitTypeEnum.horizontal; for (int k = 0; k < movingObjectCoords.Count; k++) { for (int i = 0; i < staticObjects.Count; i++) { for (int p = 0; p < staticOjectCoords[i].Count; p = p + 5) { if (movingObjectCoords[k] == staticOjectCoords[i][p]) { if (p >= 0 && p < 60 || p >= 80 && p < 140) { side = HitTypeEnum.horizontal; } else { side = HitTypeEnum.vertical; } return(new CollisionData(i, side)); } } } } return(new CollisionData(-1, side)); }
public FixFileDetail(ContentTypeEnum contentTypeEnum, HitTypeEnum hitType, bool deleted, bool renamed, string path, long size) : base(path, size) { ContentType = contentTypeEnum; HitType = hitType; Deleted = deleted; Renamed = renamed; }
public void SetData() { HitType = (HitTypeEnum)((WeaponInfo >> 17) & 7); ObjectType = (ObjectTypeEnum)(HitInfo & 3); WeaponClass = (ClassTypeEnum)(WeaponInfo & 63); WeaponId = WeaponInfo >> 6; WeaponDamage = HitInfo >> 21; WeaponObjectId = (HitInfo >> 2) & 511; HitPart = (HitInfo >> 11) & 63; CharaHitPart = (HitCharaPart2Enum)HitPart; Range = Vector3.DistanceRange(FirePos, HitPos); }
private void MakeMove() { Console.WriteLine("Insert your next hit`s coordinates:"); var point = _uiHelper.GetHitPoint(_panelSize); if (point.X == -1 || point.Y == -1) { return; } _lastHitResult = _gameService.Hit(point); }
public float Range; //Alcance, HitDistance public void SetData() { HitType = (HitTypeEnum)((HitInfo >> 17) & 7); WeaponClass = (ClassTypeEnum)(WeaponInfo & 63); ObjectType = (ObjectTypeEnum)(HitInfo & 3); WeaponId = WeaponInfo >> 6; WeaponDamage = HitInfo >> 21; WeaponObjectId = (HitInfo >> 2) & 511; HitPart = (HitInfo >> 11) & 63; CharaHitPart = (HitCharaPart2Enum)HitPart; DeathType = HitPart == 29 ? CharaDeathEnum.HEADSHOT : CharaDeathEnum.DEFAULT; //(CharaDeathEnum)(HitInfo & 15) Range = Vector3.DistanceRange(StartBullet, EndBullet); }
public void Add(HitTypeEnum hitType, string path) { // for missing content.. the path is the description, i.e. desirable file name without an extension if (hitType == HitTypeEnum.Missing) { // display format: <file>.<ext1> (or .<ext2>, .<ext3>) var extensions = _contentType.Extensions.Split(",").Select(x => x.Trim().TrimStart('*')).ToList(); path = @$ "{_contentType.Folder}\{path}{extensions.First()}"; var otherExtensions = extensions.Skip(1).ToList(); if (otherExtensions.Any()) { path += $" (or {string.Join(", ", otherExtensions)})"; } }
public Hit(ContentTypeEnum contentTypeEnum, string path, HitTypeEnum type) { ContentTypeEnum = contentTypeEnum; ContentType = contentTypeEnum.GetDescription(); Path = path; File = System.IO.Path.GetFileName(path); Size = type == HitTypeEnum.Missing ? null : new FileInfo(path).Length; SizeString = type == HitTypeEnum.Missing ? null : ByteSize.FromBytes(new FileInfo(path).Length).ToString("#"); Type = type; // performance tweak - explicitly assign a property instead of relying on ToString during subsequent binding Description = ToString(); // viewmodel IsPresent = Type != HitTypeEnum.Missing; OpenFileCommand = new ActionCommand(OpenFile, _ => IsPresent); ExplorerCommand = new ActionCommand(ShowInExplorer); CopyPathCommand = new ActionCommand(CopyPath); }
private void ProcessHit(Point point) { _lastHitType = HitTypeEnum.Miss; foreach (var ship in _shipsWithHits.Keys) { if (!ShipIsHitInPoint(point, ship)) { continue; } if (_hits.Contains(point)) { _lastHitType = HitTypeEnum.AlreadyHit; return; } _lastHitType = _shipsWithHits[ship] + 1 == ship.Type.Size ? HitTypeEnum.Sink : HitTypeEnum.Hit; _shipsWithHits[ship] += 1; break; } _hits.Add(point); }
public CollisionData(int collideteStaticElementIndex, HitTypeEnum side) { this.collideteStaticElementIndex = collideteStaticElementIndex; this.side = side; }