Beispiel #1
0
        /// <summary>
        /// Gets the marker for the player or
        /// return a new one
        /// </summary>
        public Marker GetMarker(Player player)
        {
            Debug.Assert(player != null);
            if (player.Name == World.Default.You.Name)
            {
                Debug.Assert(YourMarker.Settings.Name == Marker.DefaultNames.You);
                return(YourMarker);
            }

            Marker found;

            if (_markPlayer.TryGetValue(player.Id, out found))
            {
                return(found);
            }

            MarkerSettings defaultSettings = EnemyMarker.Settings;

            if (player.HasTribe)
            {
                Marker marker;
                if (_markTribe.TryGetValue(player.Tribe.Id, out marker))
                {
                    defaultSettings = marker.Settings;
                }
            }
            return(new Marker(MarkerSettings.Create(defaultSettings.Color, defaultSettings.View)));
        }
Beispiel #2
0
        /// <summary>
        /// Gets the marker for the tribe or
        /// return a new one
        /// </summary>
        public Marker GetMarker(Tribe tribe)
        {
            Debug.Assert(tribe != null);
            if (World.Default.You.HasTribe && World.Default.You.Tribe == tribe)
            {
                Debug.Assert(YourTribeMarker.Settings.Name == Marker.DefaultNames.YourTribe);
                return(YourTribeMarker);
            }

            Marker found;

            if (_markTribe.TryGetValue(tribe.Id, out found))
            {
                return(found);
            }

            return(new Marker(MarkerSettings.Create(EnemyMarker.Settings.Color, EnemyMarker.Settings.View)));
        }