import { useRef } from 'react';
import { PLAYER_DEF } from '../utils/constants';

const useGameRefs = () => {
  const webPlayerRef = useRef(null);
  const activePlayerRef = useRef(false);
  const bombSelectedRef = useRef(false);
  const connectionLostRef = useRef(false);
  const redRef = useRef({ ...PLAYER_DEF });
  const blueRef = useRef({ ...PLAYER_DEF });
  const lastClickedRef = useRef({ red: null, blue: null });
  const endRef = useRef(false);

  return {
    webPlayerRef,
    activePlayerRef,
    bombSelectedRef,
    connectionLostRef,
    redRef,
    blueRef,
    lastClickedRef,
    endRef,
  };
};

export default useGameRefs;
