Inheritance: MonoBehaviour
示例#1
0
        public override int GetHashCode()
        {
            unchecked // Overflow is fine, just wrap
            {
                int hashCode = 41;

                if (Visible != null)
                {
                    hashCode = hashCode * 59 + Visible.GetHashCode();
                }

                if (Width != null)
                {
                    hashCode = hashCode * 59 + Width.GetHashCode();
                }

                if (FillColor != null)
                {
                    hashCode = hashCode * 59 + FillColor.GetHashCode();
                }

                if (Line != null)
                {
                    hashCode = hashCode * 59 + Line.GetHashCode();
                }

                return(hashCode);
            }
        }
示例#2
0
文件: Map.cs 项目: nistck/Jx
            internal void OnSave(TextBlock block)
            {
                if (block == null)
                {
                    return;
                }

                block.SetAttribute("name", this.Name);
                if (!Visible)
                {
                    block.SetAttribute("visible", Visible.ToString());
                }
                if (!AllowSelect)
                {
                    block.SetAttribute("allowSelect", AllowSelect.ToString());
                }
                if (!AllowEdit)
                {
                    block.SetAttribute("allowEdit", AllowEdit.ToString());
                }

                foreach (EditorLayer child in children)
                {
                    TextBlock childBlock = block.AddChild("layer");
                    child.OnSave(childBlock);
                }
            }
示例#3
0
        public XmlElement ToXML()
        {
            XmlDocument doc           = new XmlDocument();
            var         entityElement = doc.CreateElement("Entity");

            entityElement.SetAttribute("name", EntityName);
            entityElement.SetAttribute("type", EntityTypeResource);
            entityElement.SetAttribute("visible", Visible.ToString());

            // components
            lock (m_ComponentMap)
            {
                foreach (var component in m_ComponentMap.Values)
                {
                    var componentElement = component.VToXML();

                    var importedComponentNode = doc.ImportNode(componentElement, true);
                    entityElement.AppendChild(importedComponentNode);
                }
            }

            doc.AppendChild(entityElement);

            return(entityElement);
        }
示例#4
0
 public void showShop()
 {
     Button.available = true;
     status           = Visible.visible;
     position.Y       = 350;
     position.X       = 920;
 }
示例#5
0
        private void ShowVisible()
        {
            button2.Enabled = false;
            Visible cnv = new Visible(GenSelected, false);

            cnv.mShow();
            cnv.StreamOK += (o, e) =>
            {
                //Console.WriteLine("OK");
                Invoke(new Action(() => {
                    Cursor = Cursors.Default;
                    button2.BackgroundImage = Properties.Resources._54544;
                }));
            };

            cnv.CloseStream += (o, e) =>
            {
                Invoke(new Action(() => {
                    button2.Enabled = true;
                }));
            };

            cnv.Invoke(new Action(() => { cnv.Handle.SetParent(Handle); }));

            //cnv.Handle.MoveWindow(-100, -100, cnv.Width, cnv.Height, true);
        }
示例#6
0
 /// <inheritdoc />
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         if (Visible != null)
         {
             hashCode = hashCode * 59 + Visible.GetHashCode();
         }
         if (XAnchor != null)
         {
             hashCode = hashCode * 59 + XAnchor.GetHashCode();
         }
         if (Offset != null)
         {
             hashCode = hashCode * 59 + Offset.GetHashCode();
         }
         if (Prefix != null)
         {
             hashCode = hashCode * 59 + Prefix.GetHashCode();
         }
         if (Suffix != null)
         {
             hashCode = hashCode * 59 + Suffix.GetHashCode();
         }
         if (Font != null)
         {
             hashCode = hashCode * 59 + Font.GetHashCode();
         }
         return(hashCode);
     }
 }
示例#7
0
        /// <inheritdoc />
        public bool Equals([AllowNull] Box other)
        {
            if (other == null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Visible == other.Visible ||
                     Visible != null &&
                     Visible.Equals(other.Visible)
                     ) &&
                 (
                     Width == other.Width ||
                     Width != null &&
                     Width.Equals(other.Width)
                 ) &&
                 (
                     FillColor == other.FillColor ||
                     FillColor != null &&
                     FillColor.Equals(other.FillColor)
                 ) &&
                 (
                     Line == other.Line ||
                     Line != null &&
                     Line.Equals(other.Line)
                 ));
        }
示例#8
0
        /// <summary>
        /// Converts this shape C# using the KimonoCore library.
        /// </summary>
        /// <returns>The kimono core.</returns>
        public override string ToKimonoCore()
        {
            var sourceCode = "";

            // Build with Skia
            sourceCode += $"// Draw {Name} shape\n" +
                          $"var {ElementName} = new KimonoShapeArrow({Left}f, {Top}f, {Right}f, {Bottom}f)" + "{" +
                          $"\n\tRotationDegrees = {RotationDegrees}," +
                          $"\n\tVisible = {Visible.ToString().ToLower()}," +
                          $"\n\tStyle = {Style.ElementName}," +
                          $"\n\tHasStartHead = {HasStartHead.ToString().ToLower()}," +
                          $"\n\tHasEndHead = {HasEndHead.ToString().ToLower()}," +
                          $"\n\tHeadInnerRatio = {HeadInnerRatio}," +
                          $"\n\tHeadOuterRatio = {HeadOuterRatio}," +
                          $"\n\tIsStreamlined = {IsStreamlined.ToString().ToLower()}" +
                          "};\n";

            // Add any connections
            var connections = ConnectionsToKimonoCore();

            if (connections != null)
            {
                sourceCode += $"\n{connections}\n";
            }

            // Draw shape
            sourceCode += $"{ElementName}.Draw(canvas);\n";

            // Return code
            return(sourceCode);
        }
示例#9
0
文件: RPAS.cs 项目: wildbook/WallAI
 public Configuration(float radiusFudge, bool notVisibleBlocksVision, Visible restrictiveness, bool visibleOnEqual)
 {
     RadiusFudge            = radiusFudge;
     NotVisibleBlocksVision = notVisibleBlocksVision;
     Restrictiveness        = restrictiveness;
     VisibleOnEqual         = visibleOnEqual;
 }
示例#10
0
        private async void BtsClick(string btName)
        {
            switch (btName)
            {
            case "GuardarUsuario":
                string nom = Usuari;

                string wsUri = string.Format("wss://localhost:44387/api/websocket?nom={0}", nom);
                await socket.ConnectAsync(new Uri(wsUri), cts.Token);

                TaskFactoryStartNew(cts, socket);
                Visible = "Hidden";
                break;

            case "Enviar":
                if (Visible.Equals("Hidden"))
                {
                    var missatge = Mensaje;
                    if (missatge == "Adeu")
                    {
                        cts.Cancel();
                        System.Environment.Exit(0);
                        return;
                    }
                    byte[] sendBytes  = Encoding.UTF8.GetBytes(missatge);
                    var    sendBuffer = new ArraySegment <byte>(sendBytes);
                    await socket.SendAsync(sendBuffer, WebSocketMessageType.Text, endOfMessage : true, cancellationToken : cts.Token);

                    Mensaje = "";
                }
                break;
            }
        }
示例#11
0
        protected void SetControlProps(Control control)
        {
            var eventCtrl = control as IPsEventControl;

            if (eventCtrl != null)
            {
                eventCtrl.Cmdlet = this;
            }

            control.Id      = Id;
            control.Width   = Width;
            control.Height  = Height;
            control.Padding = Padding;
            control.Margin  = Margin;

            if (Visible.IsPresent)
            {
                control.Visible = Visible.ToBool();
            }

            if (Disabled.IsPresent)
            {
                control.Disabled = Disabled.ToBool();
            }

            control.Data = Data;
        }
示例#12
0
 public void showShop()
 {
     Button.available = true;
     status = Visible.visible;
     position.Y = 350;
     position.X = 920;
 }
示例#13
0
 protected virtual PXFieldState AdjustStateBySelf(PXFieldState state)
 {
     state.Enabled = false;
     Visible.With(it => state.Visible         = it);
     DisplayName.With(it => state.DisplayName = PXMessages.LocalizeFormatNoPrefix(it));
     return(state);
 }
示例#14
0
        /// <inheritdoc />
        public bool Equals([AllowNull] MeanLine other)
        {
            if (other == null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Visible == other.Visible ||
                     Visible != null &&
                     Visible.Equals(other.Visible)
                     ) &&
                 (
                     Color == other.Color ||
                     Color != null &&
                     Color.Equals(other.Color)
                 ) &&
                 (
                     Width == other.Width ||
                     Width != null &&
                     Width.Equals(other.Width)
                 ));
        }
示例#15
0
        public override bool Equals(object o)
        {
            if (!(o is Scripting))
            {
                return(false);
            }
            Scripting v = o as Scripting;

            if (!Enabled.Equals(v.Enabled))
            {
                return(false);
            }
            if (!ParameterString.Equals(v.ParameterString))
            {
                return(false);
            }
            if (!ScriptFile.Equals(v.ScriptFile))
            {
                return(false);
            }
            if (!Visible.Equals(v.Visible))
            {
                return(false);
            }
            if (!WaitForScript.Equals(v.WaitForScript))
            {
                return(false);
            }
            return(true);
        }
示例#16
0
 /// <inheritdoc />
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         if (Visible != null)
         {
             hashCode = hashCode * 59 + Visible.GetHashCode();
         }
         if (Side != null)
         {
             hashCode = hashCode * 59 + Side.GetHashCode();
         }
         if (EdgeShape != null)
         {
             hashCode = hashCode * 59 + EdgeShape.GetHashCode();
         }
         if (Thickness != null)
         {
             hashCode = hashCode * 59 + Thickness.GetHashCode();
         }
         if (TextFont != null)
         {
             hashCode = hashCode * 59 + TextFont.GetHashCode();
         }
         return(hashCode);
     }
 }
示例#17
0
        public void ToXml(XmlWriter writer)
        {
            var provider = new NumberFormatInfo {
                NumberDecimalSeparator = GlobalProfile.DecimalSymbolStandard.ToString()
            };

            var cultureInfo = new CultureInfo("")
            {
                NumberFormat = { NumberDecimalSeparator = GlobalProfile.DecimalSymbolStandard.ToString() }
            };

            cultureInfo.TextInfo.ListSeparator = GlobalProfile.ArgumentsSeparatorStandard.ToString();

            var colorConverter               = TypeDescriptor.GetConverter(typeof(Color));
            var dashStyleConverter           = TypeDescriptor.GetConverter(typeof(DashStyle));
            var plotLinesMethodEnumConverter = TypeDescriptor.GetConverter(typeof(PlotLinesMethodEnum));

            writer.WriteAttributeString("isvisible", Visible.ToString().ToLower());
            writer.WriteAttributeString("plotmethod", plotLinesMethodEnumConverter.ConvertToString(PlotMethod));

            writer.WriteAttributeString("lineantialias", AntiAlias.ToString().ToLower());
            writer.WriteAttributeString("linecolor", colorConverter.ConvertToString(null, cultureInfo, LineColor));
            writer.WriteAttributeString("linethickness", Thickness.ToString(provider));
            writer.WriteAttributeString("linepattern", dashStyleConverter.ConvertToString(Pattern));
        }
示例#18
0
        /// <summary>
        /// Converts this shape C# using the KimonoCore library.
        /// </summary>
        /// <returns>The kimono core.</returns>
        public override string ToKimonoCore()
        {
            var sourceCode = "";

            // Build with Kimono Core
            sourceCode += $"// Build {Name} shape\n" +
                          $"var {ElementName} = new KimonoShapeBezier({Left}f, {Top}f, {Right}f, {Bottom}f)" + "{" +
                          $"\n\tRotationDegrees = {RotationDegrees}," +
                          $"\n\tVisible = {Visible.ToString().ToLower()}," +
                          $"\n\tStyle = {Style.ElementName}," +
                          $"\n\tClosed = {Closed.ToString().ToLower()}" +
                          "};\n\n";

            // Add the points to the shape
            sourceCode += $"// Add points to {Name} shape\n";
            foreach (KimonoBezierPoint point in Points)
            {
                sourceCode += $"{ElementName}.AddPoint({point.ControlPoint.X}f, {point.ControlPoint.Y}f, {point.EndPoint.X}f, {point.EndPoint.Y}f);\n";
            }

            // Add any connections
            var connections = ConnectionsToKimonoCore();

            if (connections != null)
            {
                sourceCode += $"\n{connections}";
            }

            // Draw shape
            sourceCode += $"\n// Draw {Name} shape\n" +
                          $"{ElementName}.Draw(canvas);\n";

            // Return code
            return(sourceCode);
        }
示例#19
0
 /*
  * void UpdateNearby()
  * {
  *  PreviousNearbyUpdateTicks++;
  *  if ((PreviousNearbyUpdatePos - Pos).MagSq() > EyeRadiusExtra * EyeRadiusExtra||PreviousNearbyUpdateTicks>PreviousNearbyUpdateTicksMax)
  *  {
  *      PreviousNearbyUpdateTicks = 0;
  *      PreviousNearbyUpdatePos = Pos;
  *      NearbyObjects = new List<BaseObject>();
  *      float R = EyeRadius + EyeRadiusExtra*2 + Radius;
  *      float RR = R * R;
  *      foreach (Creature C in Form1.Creatures)
  *      {
  *          if (C != this)
  *              if ((C.Pos - Pos).MagSq() < RR)
  *                  NearbyObjects.Add(C);
  *
  *      }
  *      foreach (var S in Form1.Seeds)
  *      {
  *          if ((S.Pos - Pos).MagSq() < RR)
  *              NearbyObjects.Add(S);
  *      }
  *      foreach (Tree T in Form1.Trees)
  *      {
  *          if ((T.Pos - Pos).MagSq() < RR)
  *              NearbyObjects.Add(T);
  *      }
  *      foreach (Egg E in Form1.Eggs)
  *      {
  *          if ((E.Pos - Pos).MagSq() < RR)
  *              NearbyObjects.Add(E);
  *      }
  *      foreach (var T in Form1.Trees)
  *      {
  *          foreach (var F in T.GetAllFlowers())
  *          {
  *              if ((F.Pos - Pos).MagSq() < RR)
  *                  NearbyObjects.Add(F);
  *          }
  *      }
  *  }
  * }*/
 public void UpdateVision(Visible V)
 {
     foreach (var E in Eyes)
     {
         E.Add(V);
     }
 }
示例#20
0
        private static void UpdateIsShowing(DependencyObject element)
        {
            if (element == null)
            {
                return;
            }

            if (!Visible.IsVisible(element) ||
                !Loaded.IsLoaded(element))
            {
                element.SetIsShowing(false);
                return;
            }

            var isVisible = GetIsVisible(element);

            if (isVisible != null)
            {
                element.SetIsShowing(isVisible.Value);
                return;
            }

            var content = GetContent(element);

            element.SetIsShowing(content != null);
        }
示例#21
0
 private void SendLostMessage(Visible observee)
 {
     foreach (Component listener in visionListeners)
     {
         ((IVisionListener)listener).OnLost(observee);
     }
 }
示例#22
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="other"></param>
 /// <returns></returns>
 public virtual bool Equals(Material other)
 {
     if (other == null)
     {
         return(false);
     }
     return(AlphaTest.Equals(other.AlphaTest) &&
            Blending.Equals(other.Blending) &&
            ClipIntersections.Equals(other.ClipIntersections) &&
            ClipShadows.Equals(other.ClipShadows) &&
            ColorWrite.Equals(other.ColorWrite) &&
            DepthTest.Equals(other.DepthTest) &&
            DepthWrite.Equals(other.DepthWrite) &&
            Dithering.Equals(other.Dithering) &&
            FlatShading.Equals(other.FlatShading) &&
            Fog.Equals(other.Fog) &&
            Lights.Equals(other.Lights) &&
            Opacity.Equals(other.Opacity) &&
            Overdraw.Equals(other.Overdraw) &&
            PremultipliedAlpha.Equals(other.PremultipliedAlpha) &&
            Side.Equals(other.Side) &&
            Transparent.Equals(other.Transparent) &&
            VertexColors.Equals(other.VertexColors) &&
            Visible.Equals(other.Visible) &&
            UserData == other.UserData &&
            ClippingPlanes == other.ClippingPlanes &&
            string.Equals(Precision, other.Precision));
 }
示例#23
0
        public override int GetHashCode()
        {
            var hashCode = 459946268;

            hashCode = hashCode * -1521134295 + EqualityComparer <InfoboxAction[]> .Default.GetHashCode(Actions);

            hashCode = hashCode * -1521134295 + CloseDelayTime.GetHashCode();
            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Description);

            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(HtmlContent);

            hashCode = hashCode * -1521134295 + EqualityComparer <Location> .Default.GetHashCode(Location);

            hashCode = hashCode * -1521134295 + MaxHeight.GetHashCode();
            hashCode = hashCode * -1521134295 + MaxWidth.GetHashCode();
            hashCode = hashCode * -1521134295 + EqualityComparer <GeolocatonPoint> .Default.GetHashCode(Offset);

            hashCode = hashCode * -1521134295 + ShowCloseButton.GetHashCode();
            hashCode = hashCode * -1521134295 + ShowPointer.GetHashCode();
            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Title);

            hashCode = hashCode * -1521134295 + Visible.GetHashCode();
            hashCode = hashCode * -1521134295 + ZIndex.GetHashCode();
            return(hashCode);
        }
示例#24
0
 private void SendNoticedMessage(Visible observee)
 {
     foreach (Component listener in visionListeners)
     {
         ((IVisionListener)listener).OnNoticed(observee);
     }
 }
示例#25
0
 public void SetToVisibleIfFogInNextFrame()
 {
     if (visible == Visible.fog)
     {
         visibleInNextFrame = Visible.visible;
     }
 }
        public override int GetHashCode()
        {
            var hashCode = -1067145431;

            hashCode = hashCode * -1521134295 + base.GetHashCode();
            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(CustomizedType);

            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(FieldFormat);

            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Regexp);

            hashCode = hashCode * -1521134295 + EqualityComparer <int?> .Default.GetHashCode(MinLength);

            hashCode = hashCode * -1521134295 + EqualityComparer <int?> .Default.GetHashCode(MaxLength);

            hashCode = hashCode * -1521134295 + IsRequired.GetHashCode();
            hashCode = hashCode * -1521134295 + IsFilter.GetHashCode();
            hashCode = hashCode * -1521134295 + Searchable.GetHashCode();
            hashCode = hashCode * -1521134295 + Multiple.GetHashCode();
            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(DefaultValue);

            hashCode = hashCode * -1521134295 + Visible.GetHashCode();
            hashCode = hashCode * -1521134295 + EqualityComparer <IList <CustomFieldPossibleValue> > .Default.GetHashCode(PossibleValues);

            hashCode = hashCode * -1521134295 + EqualityComparer <IList <TrackerCustomField> > .Default.GetHashCode(Trackers);

            hashCode = hashCode * -1521134295 + EqualityComparer <IList <CustomFieldRole> > .Default.GetHashCode(Roles);

            return(hashCode);
        }
示例#27
0
 //TODO: track state for current and next frame
 public void SetToFogIfVisibleInNextFrame()
 {
     if (visible == Visible.visible)
     {
         visibleInNextFrame = Visible.fog;
     }
 }
示例#28
0
        private static void UpdateIsShowing(DependencyObject element)
        {
            if (element == null)
            {
                return;
            }

            if (!Visible.IsVisible(element) ||
                !Loaded.IsLoaded(element))
            {
                element.SetIsShowing(false);
                return;
            }

            var template  = GetTemplate(element);
            var isVisible = GetIsVisible(element);

            if (template != null && isVisible != null)
            {
                element.SetIsShowing(isVisible.Value);
                return;
            }

            element.SetIsShowing(template != null);
        }
示例#29
0
        private void Update()
        {
            if (!Singleton.Manager <ManPointer> .inst.DraggingItem && Input.GetMouseButtonDown(1))
            {
                try
                {
                    module = Singleton.Manager <ManPointer> .inst.targetVisible;
                }
                catch
                {
                    //Console.WriteLine(e);
                    //module = null;
                }
            }

            try
            {
                if (Input.GetKeyDown(KeyCode.BackQuote))
                {
                    ShowGUI = !ShowGUI;
                    GUIDisp.SetActive(ShowGUI);
                    if (ShowGUI == false)
                    {
                        Class1.config.WriteConfigJsonFile();
                        module = null;
                        log    = "Right-click on a block to select it here";
                    }
                }
            }
            catch (Exception E)
            {
                Console.WriteLine("EXCEPTION: " + E.Message + "\n" + E.StackTrace);
            }
        }
示例#30
0
    //
    // IVisionListener
    //

    public void OnNoticed(Visible observee)
    {
        // если у нас уже есть текущая цель, то похуй кто там пришёл
        if (targetVictim != null)
        {
            return;
        }

        // если мы двигаемся не замечая никого, нам похуй
        if (activeOrder == CreepState.Move)
        {
            return;
        }

        Health target = observee.GetComponent <Health>();

        if (target == null)
        {
            return;
        }

        if (!attack.CheckTarget(target))
        {
            return;
        }

        attack.AppointTarget(target);
        legs.FollowTarget(target.myPosition);
        targetVictim = target;
    }
示例#31
0
        /// <summary>
        /// Converts this shape C# using the KimonoCore library.
        /// </summary>
        /// <returns>The kimono core.</returns>
        public override string ToKimonoCore()
        {
            var sourceCode = "";

            // Build with KimonoCore
            sourceCode += $"// Draw {Name} shape\n" +
                          $"var {ElementName} = new KimonoShapeLine({Left}f, {Top}f, {Right}f, {Bottom}f)" + "{" +
                          $"\n\tRotationDegrees = {RotationDegrees}," +
                          $"\n\tVisible = {Visible.ToString().ToLower()}," +
                          $"\n\tStyle = {Style.ElementName}" +
                          "};\n";

            // Add any connections
            var connections = ConnectionsToKimonoCore();

            if (connections != null)
            {
                sourceCode += $"\n{connections}\n";
            }

            // Draw shape
            sourceCode += $"{ElementName}.Draw(canvas);\n";

            // Return code
            return(sourceCode);
        }
示例#32
0
    public void OnLost(Visible observee)
    {
        Health target = observee.GetComponent<Health>();
        if ( target != null && target == currentTarget ) {

            currentTarget = null;
            SendLostAppointedTargetMessage();

        }
    }
示例#33
0
        private void _Join(IIndividual individual)
        {
            var v = new Visible(individual);
            v.Initial();
            this._Set.Add(individual.Id , v);
            this._QuadTree.Insert(v);

            if(individual.EntityType == ENTITY.ENTRANCE)
            {
                _EntranceSet.Add(v);
            }
        }
示例#34
0
文件: Vision.cs 项目: golergka/Vision
	// It may be better to switch to Lists in some situations.

	// Basic array management, nothing particularly interesting here.

	private void AddVisible(Visible visible) {

		for(int i = 0; i<VISION_LIMIT; i++) {
		
			if (visiblesInSight[i] == null) {
				visiblesInSight[i] = visible;
				return;
			}

		}
		
		Debug.LogError("No place for new visible!");

	}
示例#35
0
    public void ChangedVisibility(Visible visible)
    {
        if (visible.visible) {

            RemoveInvisible(visible);
            AddVisible(visible);
            SendNoticedMessage(visible);

        } else {

            RemoveVisible(visible);
            AddInvisible(visible);
            SendLostMessage(visible);

        }
    }
示例#36
0
        public static DocumentObject Build(UploadedFile fileData,
            string spaceId,
            string spaceSeqNo,
            string spaceName,
            string userId,
            string userName,
            string depId,
            Visible visible)
        {
            var fileName = fileData.ClientName;

            _logger.Debug("存储原始文件...");

            Guid fileId = Guid.NewGuid();
            _logger.Debug("存储原始文件完成");
            var document = new DocumentObject
            {
                Id = fileId,
                FileName = fileName,
                StorePath = fileData.ServerLocation,
                FileSize = fileData.ContentLength,
                CreateTime = DateTime.Now,
                DocumentType = fileName.ToDocumentType(),
                UpdateTime = DateTime.Now,
                CreateUserId = userId,
                CreateUserName = userName,
                SpaceId = spaceId,
                SpaceSeqNo = spaceSeqNo,
                SpaceName = spaceName,
                UpdateUserId = userId,
                UpdateUserName = userName,
                IsConvert = false,
                Visible = (int)visible,
                DepId = depId,
            };

            document.DisplayPath = DocumentSettings.GetDisplayUrl(Path.GetFileName(document.ConvertPath));

            return document;
        }
示例#37
0
文件: Vision.cs 项目: golergka/Vision
	// Here we check if the Visible is in our range.
	// It's quite easy to change from 2d to 3d mechanics with a single define.
	// 2d is supposed to be faster. I didn't test it yet.
	// It's premature optimization. It's the root of all evil. I'm the f*****g devil.
	private bool VisibleInRange(Visible observee) {

#if VISION_2D

	Vector2 observee2d = new Vector2(observee.transform.position.x, observee.transform.position.z);
	Vector2 position2d = new Vector2(transform.position.x, transform.position.z);
	Vector2 difference = observee2d - position2d;
	return (difference.sqrMagnitude < sqrVisionDistance);

#endif

#if VISION_3D

	Vector3 difference = observee.transform.position - transform.position;
	return (difference.sqrMagnitude < sqrVisionDistance);

#endif

	}
示例#38
0
 public void OnNoticed(Visible observee)
 {
     // Я сделан из мяса.
 }
示例#39
0
    private void RemoveVisible(Visible visible)
    {
        for(int i = 0; i<VISION_LIMIT; i++) {

            if (visiblesInSight[i] == visible) {
                visiblesInSight[i] = null;
                return;
            }

        }

        Debug.LogError("Visible to remove not found!");
    }
示例#40
0
 //---------------------------------------------------------------------
 public PropAttrEditor(string enditor_name, Visible v = PropAttrEditor.Visible.Show)
 {
     EditorName = enditor_name;
     IsVisible = v;
 }
示例#41
0
 private void SendLostMessage(Visible observee)
 {
     foreach(Component listener in visionListeners)
         ( (IVisionListener)listener ).OnLost(observee);
 }
示例#42
0
        /// <summary>
        /// 设置权限
        /// </summary>
        /// <param name="id"></param>
        /// <param name="visible"></param>
        /// <returns></returns>
        //   public enum Visible
        //   {
        //      Public,0
        //      Dep,1
        //      Private,2
        //   }
        public DocumentObject SetVisiblity(string id, Visible visible)
        {
            _logger.Info("DocumentService 设置权限");

            var document = GetDocument(id);
            if (document != null)
            {
                document.Visible = (int)visible;
                return Update(document);
            }
            throw new Exception(ErrorMessages.GetErrorMessages(ErrorMessages.FileNotExist));
        }
示例#43
0
 //
 // Messaging
 //
 private void SendNoticedMessage(Visible observee)
 {
     foreach(Component listener in visionListeners)
         ( (IVisionListener)listener ).OnNoticed(observee);
 }
示例#44
0
    //
    // IVisionListener
    //
    public void OnNoticed(Visible observee)
    {
        // если у нас уже есть текущая цель, то похуй кто там пришёл
        if (targetVictim != null)
            return;

        // если мы двигаемся не замечая никого, нам похуй
        if (activeOrder == CreepState.Move)
            return;

        Health target = observee.GetComponent<Health>();

        if (target == null)
            return;

        if (!attack.CheckTarget(target))
            return;

        attack.AppointTarget(target);
        legs.FollowTarget(target.myPosition);
        targetVictim = target;
    }
示例#45
0
        /// <summary>
        /// 001_西山区|4567_虹桥立交|8889_日常巡检 解析为三个文件夹
        /// 西山区(001)
        ///   |
        ///   |---虹桥立交(4567)
        ///         |
        ///         |----日常巡检(8889)
        /// </summary>
        /// <param name="parentId"></param>
        /// <param name="path"></param>
        /// <param name="userId"></param>
        /// <param name="userName"></param>
        /// <returns></returns>
        public SpaceObject MakeSpace(string parentId, string path, string userId, string userName, string depId, Visible visible)
        {
            _logger.Debug("Enter MakeSpace");

            SpaceObject space = GetDefaultSpace();
            if (string.IsNullOrWhiteSpace(parentId))
            {
                parentId = space.Id.ToString();
            }

            string[] paths = path.Split('|');
            foreach (var parameter in paths)
            {
                string spaceSeqNo = string.Empty;
                string spaceName = string.Empty;
                if (TryParse(parameter, ref spaceSeqNo, ref spaceName))
                {
                    space = GetSpaceBySeqNo(spaceSeqNo);
                    if (space == null)
                    {
                        space = Add(parentId, spaceSeqNo, spaceName, userId, userName,  depId, visible);
                    }
                    if (space.IsDelete)
                    {
                        space = Recovery(space.Id.ToString());
                    }
                    parentId = space.Id.ToString();
                }
            }

            return space;
        }
示例#46
0
        /// <summary>
        /// 设置权限,TODO:添加单元测试
        /// </summary>
        /// <param name="id"></param>
        /// <param name="visible"></param>
        /// <returns></returns>
        //   public enum Visible
        //   {
        //      Public,0
        //      Dep,1
        //      Private,2
        //   }
        public SpaceObject SetVisiblity(string Id, Visible visible)
        {
            _logger.Info("SpaceService 设置权限");

            var space = _spaceRepository.Update(f => f.Id.ToString() == Id, f => f.Visible = (int)visible).ToObject<SpaceObject>();

            if (space != null)
            {
                _cacheService.Update(space);

                SetChildrenVisiblity(Id, visible);
            }

            return space;
        }
示例#47
0
 public SpaceObject Add(string parentId, string spaceSeqNo, string name, string userId, string userName, string depId, Visible visible)
 {
     var spaceObject = MakeSpaceContract(parentId, spaceSeqNo, name, userId, userName, depId, (int)visible);
     return Add(spaceObject);
 }
示例#48
0
        private void SetChildrenVisiblity(string parentId, Visible visible)
        {
            var spaces = _spaceRepository.UpdateAll(f => f.ParentId == parentId, f => f.Visible = (int)visible).ConvertAll(
                f => f.ToObject<SpaceObject>());

            if (spaces.Count > 0)
            {
                _cacheService.UpdateAll(spaces);

                foreach (var entity in spaces)
                {
                    SetChildrenVisiblity(entity.Id.ToString(), visible);
                }
            }
        }
示例#49
0
 public void OnLost(Visible observee)
 {
     // Нам похуй.
     // Если мы потеряли нашу текущую цель, то мы всё равно узнаем об этом от компонента Attack.
 }
示例#50
0
        private SpaceObject TestVisiblity(SpaceObject space, Visible visible, ref SpaceObject childspace,
            ref SpaceObject childspace2, ref SpaceObject childspace_son)
        {
            space = _spaceService.SetVisiblity(space.Id.ToString(), visible);
            space = _spaceService.GetSpace(space.Id.ToString());
            Assert.IsTrue(space.Visible == (int) visible);

            childspace = _spaceService.GetSpace(childspace.Id.ToString());
            Assert.IsTrue(childspace.Visible == (int) visible);

            childspace2 = _spaceService.GetSpace(childspace2.Id.ToString());
            Assert.IsTrue(childspace2.Visible == (int) visible);

            childspace_son = _spaceService.GetSpace(childspace_son.Id.ToString());
            Assert.IsTrue(childspace_son.Visible == (int) visible);
            return space;
        }