Esempio n. 1
0
        public void AddConnectionOnGrid(Direction direction, Vector2 gridPos)
        {
            if (!ConnectedGridPositions.ContainsKey(direction))
            {
                ConnectedGridPositions.Add(direction, gridPos);

                _directionFlag |= direction;

                UpdateWireType();
            }
        }
Esempio n. 2
0
        public void RemoveConnection(Direction direction)
        {
            if (ConnectedGridPositions.ContainsKey(direction))
            {
                var connection = GetConnection(direction);

                ConnectedGridPositions.Remove(direction);

                if (connection)
                {
                    ClearBridges(Connections[direction]);
                }

                _directionFlag ^= direction;

                UpdateWireType();
                UpdateConnections();
            }
        }