House.House.GetHouseNameImInside C# (CSharp) Méthode

GetHouseNameImInside() public méthode

public GetHouseNameImInside ( Terraria_Server.Player player ) : string
player Terraria_Server.Player
Résultat string
        public string GetHouseNameImInside(Player player)
        {
            foreach (PlayerHouses playerHouse in playerHouses)
            {
                foreach (PlayerHouseCoords playerHouseCoord in playerHouse.Houses)
                {
                    if (player.Position.X / 16 >= playerHouseCoord.TopLeft.X && player.Position.X / 16 <= playerHouseCoord.BottomRight.X &&
                        player.Position.Y / 16 >= playerHouseCoord.TopLeft.Y && player.Position.Y / 16 <= playerHouseCoord.BottomRight.Y)
                        return playerHouseCoord.HouseName + " owned by " + playerHouse.PlayerName;
                }
            }

            return null;
        }