예제 #1
0
    public bool AddItem(ulong id)
    {
        DeltaMove dm = new DeltaMove(Vector3.zero, Vector3.zero);

        if (!this.items.ContainsKey(id))
        {
            this.items.Add(id, dm);
            return(true);
        }

        return(false);
    }
예제 #2
0
    // Changes the DeltaMove for the current tick
    // Pos and Rot are the new coordinates received by server before changing them in EntityHandler
    public void DefineMovement(EntityType type, ulong id, float3 pos, float3 rot)
    {
        Vector3 posV, rotV;

        posV = new Vector3(pos.x, pos.y, pos.z);
        rotV = new Vector3(rot.x, rot.y, rot.z);

        DeltaMove dm = new DeltaMove(posV - this.handler.GetLastPosition(type, id), rotV - this.handler.GetLastRotation(type, id));

        if (type == EntityType.PLAYER)
        {
            if (this.players.ContainsKey(id))
            {
                this.players[id] = dm;
            }
            else if (type == EntityType.DROP)
            {
                if (this.items.ContainsKey(id))
                {
                    this.items[id] = dm;
                }
            }
        }
    }
예제 #3
0
 public override string ToString()
 {
     return(DeltaMove.ToString() + " - " + PlayerName() + " - (" + EstimationScore + ")");
 }
예제 #4
0
 public bool Equals(DeltaMove dm)
 {
     return(this.deltaPos == dm.deltaPos && this.deltaRot == dm.deltaRot);
 }