public Cell GetCellFromPosition(float x, float y) { Cell c = null; int cellID = 0; while (cellID < Cells.Length && c == null) // Complexité maximale : Cells.Length. { Cell cell = Cells[cellID]; if (cell.GetPosition().x <= y && cell.GetPosition().x + cell.GetDimensions().y > y) { if (cell.GetPosition().z <= x && cell.GetPosition().z + cell.GetDimensions().x > x) { c = cell; } } cellID++; } return(c); }
public BloodAndBileEngine.Entity SpawnPlayer(int playerConnectionID, BloodAndBileEngine.WorldState.Cell cell) { BloodAndBileEngine.Debugger.Log("SpawnPlayer aux coordonnées " + cell.GetPosition()); BloodAndBileEngine.Entity player = EntityFactory.BuildPlayer(cell.GetPosition(), UnityEngine.Quaternion.identity, 0.5f, 2.0f); return(player); }