fix convention

This commit is contained in:
hydrant
2019-09-12 19:40:36 +02:00
parent 063ced7b47
commit df82f8f291
4 changed files with 32 additions and 34 deletions

View File

@@ -2907,7 +2907,6 @@ namespace ReallifeGamemode.Server.Commands
business.Update();
return;
}
break;
}
player.SendChatMessage("~m~Benutzung:~s~ /business [price] [Option]");

View File

@@ -14,6 +14,17 @@ namespace ReallifeGamemode.Server.Job
public override bool NeedVehicleToStart => true;
private readonly IReadOnlyCollection<Vector3> list = new List<Vector3>
{
new Vector3(-105.5951, -1684.548, 29.23948),
new Vector3(-1056.246, -2552.576, 13.66063),
new Vector3(200.3088, -1978.828, 19.3329),
new Vector3(358.6138, -1785.821, 28.92113),
new Vector3(281.8594, -1462.503, 29.13148),
new Vector3(77.72239, -1212.086, 29.12294),
new Vector3(218.1398, -850.9549, 30.16619)
}.AsReadOnly();
public BusDriverJob()
{
JobStart += BusDriverJob_JobStart;
@@ -21,15 +32,7 @@ namespace ReallifeGamemode.Server.Job
private void BusDriverJob_JobStart(Client player)
{
List<Vector3> list = new List<Vector3>();
list.Add(new Vector3(-105.5951, -1684.548, 29.23948));
list.Add(new Vector3(-1056.246, -2552.576, 13.66063));
list.Add(new Vector3(200.3088, -1978.828, 19.3329));
list.Add(new Vector3(358.6138, -1785.821, 28.92113));
list.Add(new Vector3(281.8594, -1462.503, 29.13148));
list.Add(new Vector3(77.72239, -1212.086, 29.12294));
list.Add(new Vector3(218.1398, -850.9549, 30.16619));
CheckPointHandle.startCheckPointRoute(player, list);
CheckPointHandle.StartCheckPointRoute(player, list);
}
}
}

View File

@@ -1,15 +1,9 @@
using GTANetworkAPI;
using ReallifeGamemode.Server.Entities;
using ReallifeGamemode.Server.Managers;
using ReallifeGamemode.Server.Models;
using ReallifeGamemode.Server.Services;
using ReallifeGamemode.Server.Util;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ReallifeGamemode.Server.Util;
using System.Collections;
namespace ReallifeGamemode.Server.Job
{

View File

@@ -14,17 +14,17 @@ namespace ReallifeGamemode.Server.Util
{
public class CheckPointHandle : Script
{
public static List<checkPointListForPlayer> listHandle = new List<checkPointListForPlayer>();
public static void startCheckPointRoute(Client player, List<Vector3> nListCps)
public static List<CheckPointListForPlayer> listHandle = new List<CheckPointListForPlayer>();
public static void StartCheckPointRoute(Client player, IEnumerable<Vector3> nListCps)
{
checkPointListForPlayer playerHandle = new checkPointListForPlayer(player, nListCps);
CheckPointListForPlayer playerHandle = new CheckPointListForPlayer(player, nListCps);
listHandle.Add(playerHandle);
playerHandle.startRoute();
playerHandle.StartRoute();
}
public static void removePlayerHandlerFromList(Client player)
public static void RemovePlayerHandlerFromList(Client player)
{
checkPointListForPlayer temp = null;
CheckPointListForPlayer temp = null;
for (int a = 0; a < listHandle.Count; a++)
{
temp = listHandle[a];
@@ -36,9 +36,9 @@ namespace ReallifeGamemode.Server.Util
}
[RemoteEvent("playerInCheckpoint")]
public void playerInCheckpoint(Client user)
public void PlayerInCheckpoint(Client user)
{
checkPointListForPlayer temp = null;
CheckPointListForPlayer temp = null;
for (int a = 0; a < listHandle.Count; a++)
{
temp = listHandle[a];
@@ -48,43 +48,45 @@ namespace ReallifeGamemode.Server.Util
}
}
temp.nextCheckpoint();
temp.NextCheckpoint();
ChatService.Broadcast("neuer cp");
}
}
public class checkPointListForPlayer
public class CheckPointListForPlayer
{
public List<Vector3> list = new List<Vector3>();
public IEnumerable<Vector3> list = new List<Vector3>();
public Client player;
Vector3 checkPoint;
Boolean done;
bool done;
int checkPointsDone = 0;
public checkPointListForPlayer(Client nPlayer, List<Vector3> nList)
public CheckPointListForPlayer(Client nPlayer, IEnumerable<Vector3> nList)
{
this.player = nPlayer;
this.list = nList;
}
public void startRoute()
public void StartRoute()
{
player.TriggerEvent("setCheckPoint", this.list.ElementAt(0), player);
}
public void nextCheckpoint()
public void NextCheckpoint()
{
this.checkPointsDone++;
if (this.list.Count > checkPointsDone)
if (this.list.Count() > checkPointsDone)
{
Vector3 nextCp = list.ElementAt(checkPointsDone);
ChatService.SendMessage(this.player, "cp set at " + nextCp.ToString());
this.player.TriggerEvent("setCheckPoint", nextCp, player);
}
if (this.list.Count == checkPointsDone)
if (this.list.Count() == checkPointsDone)
{
ChatService.SendMessage(this.player, "Du hast alle Checkpoints abgefahren!");
CheckPointHandle.removePlayerHandlerFromList(this.player);
CheckPointHandle.RemovePlayerHandlerFromList(this.player);
}
}
}