refactor: change room offset_{x,y} to just {x,y}
This commit is contained in:
@@ -3,7 +3,7 @@ defmodule Localiser.Localisation.Room.Server do
|
||||
|
||||
@pubsub Localiser.PubSub
|
||||
|
||||
defstruct [:id, :name, :offset_x, :offset_y, :width, :height, occupants: MapSet.new()]
|
||||
defstruct [:id, :name, :x, :y, :width, :height, occupants: MapSet.new()]
|
||||
|
||||
def start_link(room) do
|
||||
GenServer.start_link(__MODULE__, room, name: via(room.id))
|
||||
@@ -32,8 +32,8 @@ defmodule Localiser.Localisation.Room.Server do
|
||||
state = %__MODULE__{
|
||||
id: room.id,
|
||||
name: room.name,
|
||||
offset_x: room.offset_x || 0.0,
|
||||
offset_y: room.offset_y || 0.0,
|
||||
x: room.x || 0.0,
|
||||
y: room.y || 0.0,
|
||||
width: room.width || 0.0,
|
||||
height: room.height || 0.0
|
||||
}
|
||||
@@ -71,8 +71,8 @@ defmodule Localiser.Localisation.Room.Server do
|
||||
def handle_info({:room_updated, %{id: id} = room}, %{id: id} = state) do
|
||||
{:noreply, %{state |
|
||||
name: room.name,
|
||||
offset_x: room.offset_x || 0.0,
|
||||
offset_y: room.offset_y || 0.0,
|
||||
x: room.x || 0.0,
|
||||
y: room.y || 0.0,
|
||||
width: room.width || 0.0,
|
||||
height: room.height || 0.0
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user