<commit_before>﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Networking;

public class Asteroid : NetworkBehaviour {

	private MatrixMove mm;

	private float asteroidDistance = 550; //How far can asteroids be spawned

	private float distanceFromStation = 175; //Offset from station so it doesnt spawn into station

	private float startDelay = 0.25f;


	private void Start()
	{
		mm = GetComponent<MatrixMove>();

		if (isServer)
		{
			StartCoroutine(DelayedStart());
		}
	}

	[Server]
	public void SpawnNearStation()
	{
		//Makes sure asteroids don't spawn at/inside station
		Vector2 clampVal = Random.insideUnitCircle * asteroidDistance;
		
		if(clampVal.x > 0)
		{
			clampVal.x = Mathf.Clamp(clampVal.x, distanceFromStation, asteroidDistance);
		}
		else
		{
			clampVal.x = Mathf.Clamp(clampVal.x, -distanceFromStation, -asteroidDistance);
		}
		mm.SetPosition(clampVal);
	}

	[Server] //Asigns random rotation to each asteroid at startup for variety.
	public void RandomRotation()
	{
		int rand = Random.Range(0, 3);

		switch(rand)
		{
			case 0:
				mm.RotateTo(Orientation.Up);
				break;
			case 1:<commit_msg>Fixes very stupid mistakes I've made :-1:<commit_after>﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Networking;

public class Asteroid : NetworkBehaviour {

	private MatrixMove mm;

	private float asteroidDistance = 550; //How far can asteroids be spawned

	private float distanceFromStation = 175; //Offset from station so it doesnt spawn into station

	private float startDelay = 0.25f;


	private void Start()
	{
		mm = GetComponent<MatrixMove>();

		if (isServer)
		{
			StartCoroutine(DelayedStart());
		}
	}

	[Server]
	public void SpawnNearStation()
	{
		//Makes sure asteroids don't spawn at/inside station
		Vector2 clampVal = Random.insideUnitCircle * asteroidDistance;
		
		if(clampVal.x > 0)
		{
			clampVal.x = Mathf.Clamp(clampVal.x, distanceFromStation, asteroidDistance);
			clampVal.y = Mathf.Clamp(clampVal.y, distanceFromStation, asteroidDistance);
		}
		else
		{
			clampVal.x = Mathf.Clamp(clampVal.x, -distanceFromStation, -asteroidDistance);
			clampVal.y = Mathf.Clamp(clampVal.y, -distanceFromStation, -asteroidDistance);
		}
		mm.SetPosition(clampVal);
	}

	[Server] //Asigns random rotation to each asteroid at startup for variety.
	public void RandomRotation()
	{
		int rand = Random.Range(0, 4);

		switch(rand)
		{
			case 0:
				mm.RotateTo(Orientation.Up);
				break;
			case 1:
{'fraction_non_alphanumeric': 0.10094637223974763, 'fraction_numerical': 0.01222397476340694, 'mean_word_length': 4.013833992094861, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7547218', 'n_tokens_mistral': 955, 'n_tokens_neox': 811, 'n_words': 217}