public FuzzyCombatPosition(Borac combatant, int maxPozicija, HashSet <Igrac> leftSidePlayers)
        {
            this.slot = Math.Min((int)Math.Round(combatant.Pozicija), maxPozicija);
            if (!leftSidePlayers.Contains(combatant.Igrac))
            {
                slot *= -1;
            }

            double direction = Math.Sign(combatant.CiljnaPozicija - combatant.Pozicija);

            if (direction == 0)
            {
                if (leftSidePlayers.Contains(combatant.Igrac))
                {
                    this.delta = CombatSlotDelta.StationaryLeft;
                }
                else
                {
                    this.delta = CombatSlotDelta.StationaryRigth;
                }
            }

            else if (combatant.Pozicija >= this.slot && direction > 0)
            {
                this.delta = CombatSlotDelta.LeftOutgoing;
            }
            else if (combatant.Pozicija < this.slot && direction > 0)
            {
                this.delta = CombatSlotDelta.RightIncoming;
            }
            else if (combatant.Pozicija > this.slot && direction < 0)
            {
                this.delta = CombatSlotDelta.LeftIncoming;
            }
            else if (combatant.Pozicija <= this.slot && direction < 0)
            {
                this.delta = CombatSlotDelta.RightOutgoing;
            }
        }
Beispiel #2
0
 public CombatGUI(Borac combatant, FuzzyCombatPosition fuzzyPosition)
 {
     this.Combatant        = combatant;;
     this.LeftSidePosition = fuzzyPosition;
 }