public static List <int> GetCrossZone(int baseCell, int lenght, Database.Records.MapRecords map) { List <int> openedList = new List <int>(); openedList.Add(baseCell); int cCell = baseCell; for (int i = 0; i <= lenght - 1; i++) { cCell = map.Engine.PathfindingMaker.NextCell(cCell, 1); openedList.Add(cCell); } cCell = baseCell; for (int i = 0; i <= lenght - 1; i++) { cCell = map.Engine.PathfindingMaker.NextCell(cCell, 3); openedList.Add(cCell); } cCell = baseCell; for (int i = 0; i <= lenght - 1; i++) { cCell = map.Engine.PathfindingMaker.NextCell(cCell, 5); openedList.Add(cCell); } cCell = baseCell; for (int i = 0; i <= lenght - 1; i++) { cCell = map.Engine.PathfindingMaker.NextCell(cCell, 7); openedList.Add(cCell); } cCell = baseCell; return(openedList); }
public MapEngine(Database.Records.MapRecords map) { Map = map; PathfindingMaker = new Pathfinding("", this.Map, 0, 0); Spawner = new Map.SpawnerEngine(this); Players = new Map.PlayersMapEngine(this); }
public static int sNextCell(int cell, int dir, Database.Records.MapRecords _map) { switch (dir) { case 0: return(cell + 1); case 1: return(cell + _map.Width); case 2: return(cell + (_map.Width * 2) - 1); case 3: return(cell + _map.Width - 1); case 4: return(cell - 1); case 5: return(cell - _map.Width); case 6: return(cell - (_map.Width * 2) + 1); case 7: return(cell - _map.Width + 1); } return(-1); }
public MapEngine(Database.Records.MapRecords map) { Map = map; PathfindingMaker = new Pathfinding("", this.Map, 0, 0); Spawner = new Map.SpawnerEngine(this); Players = new Map.PlayersMapEngine(this); }
public InteractiveObject(Database.Records.MapRecords map, Enums.InteractiveObjectEnum typeID, int cellid, InteractiveObjectState state, bool isInteractive) { this.Map = map; this.TypeID = typeID; this.CellID = cellid; this.State = state; this.IsInteractive = isInteractive; }
public Pathfinding(string path, Database.Records.MapRecords map, int startCell, int startDir) { _strPath = path; _map = map; _startCell = startCell; _startDir = startDir; this.init(); }
public Pathfinding(string path, Database.Records.MapRecords map, int startCell, int startDir) { _strPath = path; _map = map; _startCell = startCell; _startDir = startDir; this.init(); }
public static List <int> GetLineZone(int baseCell, int lenght, int dir, Database.Records.MapRecords map) { var cells = new List <int>(); for (int i = 0; i <= lenght; i++) { } return(cells); }
public static int GetRemoteCaseInThisDir(int dir, int distance, int cell, Database.Records.MapRecords map) { int lastCell = cell; for (int i = 0; i <= distance; i++) { lastCell = sNextCell(lastCell, dir, map); } return(lastCell); }
public static List <int> GetJoinCell(int cell, Database.Records.MapRecords map) { List <int> cells = new List <int>(); cells.Add(map.Engine.PathfindingMaker.NextCell(cell, 1)); cells.Add(map.Engine.PathfindingMaker.NextCell(cell, 3)); cells.Add(map.Engine.PathfindingMaker.NextCell(cell, 5)); cells.Add(map.Engine.PathfindingMaker.NextCell(cell, 7)); return(cells); }
public static void Init() { Cache = Records.PaddockRecord.FindAll().ToList(); foreach (var paddock in Cache) { Database.Records.MapRecords map = World.Helper.MapHelper.FindMap(paddock.MapID); if (map != null) { map.Engine.Paddocks.Add(paddock); } } }
public Cell(int id, Database.Records.MapRecords map) { _map = map; ID = id; try { X = Pathfinding.GetCellXCoord(id, map.Width); Y = Pathfinding.GetCellYCoord(id, map.Width); } catch (Exception e) { } }
public Cell(int id, Database.Records.MapRecords map) { _map = map; ID = id; this.Parent = this; try { X = Pathfinding.GetCellXCoord(id, map.Width); Y = Pathfinding.GetCellYCoord(id, map.Width); } catch (Exception e) { } }
public static void GoToMap(WorldClient client, Database.Records.MapRecords map, int cellid, bool FirstMap = false) { if (!FirstMap && client.Character.Map != null) { client.Character.Map.Engine.RemovePlayer(client); } client.Character.MapID = map.ID; client.Character.CellID = cellid; if (client.Character.Map != null) { client.Character.Map.Engine.AddPlayer(client); client.Character.Map.Engine.ShowMap(client); //Handlers.GameHandler.GameInformationsRequest(client, ""); } else { client.Action.SystemMessage("Carte introuvable ID : <b>" + map.ID + "</b>"); } }
public static List <int> GetCircleZone(int baseCell, int radius, Database.Records.MapRecords map) { List <int> openedList = new List <int>(); openedList.Add(baseCell); for (int i = 0; i <= radius - 1; i++) { foreach (int cell in openedList.ToArray()) { List <int> joinedCells = GetJoinCell(cell, map); foreach (int jCell in joinedCells) { if (!openedList.Contains(jCell)) { openedList.Add(jCell); } } } } return(openedList); }
public static List <int> GetAllCellsForThisLinePath(int dir, int baseCell, int remoteCell, Database.Records.MapRecords map) { List <int> cells = new List <int>(); if (!map.Engine.PathfindingMaker.InLine(baseCell, remoteCell)) { return(cells); } bool pathFinished = false; int timeOut = 0; while (!pathFinished) { baseCell = map.Engine.PathfindingMaker.GetCaseIDFromDirection(baseCell, char.Parse(GetDirChar(dir)), false); if (baseCell == remoteCell) { pathFinished = true; } else { cells.Add(baseCell); } timeOut++; if (timeOut >= 30) { break; } } return(cells); }
public static int RandomJoinCell(int cell, Database.Records.MapRecords map) { return(sNextCell(cell, InLineDirPossible[Utilities.Basic.Rand(0, 3)], map)); }