public void AddLink(LinkedMap source, WarpController sourceWarp, LinkedMap destination, WarpController destinationWarp, bool reciprocal) { source.mapLinks.Add(new WarpLink(sourceWarp, destinationWarp, destination)); if (reciprocal == true) { destination.mapLinks.Add(new WarpLink(destinationWarp, sourceWarp, destination)); } }
/* * */ public MainWindow() { InitializeComponent(); // start of custom code WriteToLog.write("---- System Start ----", string.Empty, true); debug = Config.ReadElement("Debug", "False", true).Equals("true", StringComparison.OrdinalIgnoreCase); // initialize the sub classes GameBoard = new GameBoard(this); GameMap = new GameMap(this); SRS = new SRSController(this); LRS = new LRSController(this); Warp = new WarpController(this); Torpedoes = new TorpedoController(this); Phasers = new PhaserController(this); Shields = new ShieldController(this); Impulse = new ImpulseController(this); GameObjects = new GameObjects(this); DamageControl = new DamageControl(this); StarBases = new StarBaseController(this); Probes = new ProbeController(this); // set up a new board and start the timer NewGame(8); CreateTimer(); WriteToLog.write("Debug = " + debug.ToString()); WriteToLog.ClearOldLogs(); // set up the hotkeys rcImpulse.InputGestures.Add(new KeyGesture(Key.I, ModifierKeys.Control)); CommandBindings.Add(new CommandBinding(rcImpulse, ImpulseCommand)); rcWarp.InputGestures.Add(new KeyGesture(Key.W, ModifierKeys.Control)); CommandBindings.Add(new CommandBinding(rcWarp, WarpCommand)); rcTorpedoes.InputGestures.Add(new KeyGesture(Key.T, ModifierKeys.Control)); CommandBindings.Add(new CommandBinding(rcTorpedoes, TorpedoCommand)); rcPhasers.InputGestures.Add(new KeyGesture(Key.P, ModifierKeys.Control)); CommandBindings.Add(new CommandBinding(rcPhasers, PhaserCommand)); rcShields.InputGestures.Add(new KeyGesture(Key.S, ModifierKeys.Control)); CommandBindings.Add(new CommandBinding(rcShields, ShieldCommand)); }
private void OnTriggerStay(Collider other) { WarpController warpController = other.GetComponent <WarpController>(); if (warpController != null) { bool canEnter = warpController.PlayerWarpSpeed == Vector3.zero || (m_CurrentSpeed != Vector3.zero && Mathf.Sign(m_CurrentSpeed.x) != Mathf.Sign(warpController.PlayerWarpSpeed.x)); if (canEnter) { warpController.Exit.PlayerWarpSpeed = m_CurrentSpeed; Vector3 deltaEnter = warpController.transform.position - transform.position; Vector3 warpTo = warpController.Exit.transform.position + deltaEnter * 0.5f; transform.position = warpTo; } } }
public WarpLink(WarpController source, WarpController destination, LinkedMap linkedMap) { sourceWarp = source; this.linkedMap = linkedMap; destinationWarp = destination; }
// Start is called before the first frame update void Awake() { warp = FindObjectOfType <WarpController>(); }
// Start is called before the first frame update void Start() { warp = FindObjectOfType <WarpController>(); }