Exemplo n.º 1
0
 public Odb(ObjectKind cls, byte rev, byte mgo, byte pho)
 {
     this.P_ODCLS = (byte)cls;
     this.P_ODREV = rev;
     this.P_ODMGO = mgo;
     this.P_ODPHO = pho;
 }
Exemplo n.º 2
0
        private bool KeyNameToObjectPath(KeySyntax key, ObjectKind kind)
        {
            if (key.Key == null)
            {
                _diagnostics.Error(key.Span, $"The property KeySyntax.Key cannot be null");
            }

            var name = GetStringFromBasic(key.Key);

            if (string.IsNullOrWhiteSpace(name))
            {
                return(false);
            }

            _currentPath.Add(name);

            var items = key.DotKeys;

            for (int i = 0; i < items.ChildrenCount; i++)
            {
                AddObjectPath(key, kind, true);
                var dotItem = GetStringFromBasic(items.GetChildren(i).Key);
                if (string.IsNullOrWhiteSpace(dotItem))
                {
                    return(false);
                }
                _currentPath.Add(dotItem);
            }

            return(true);
        }
Exemplo n.º 3
0
        public override string ToString()
        {
            string stringRep;

            switch (ObjectKind)
            {
            case ObjectKind.Player:
                stringRep = Name;

                if (CompanyTag.Length >= 1)
                {
                    stringRep += $" <{CompanyTag}>";
                }

                break;

            default:
                stringRep = $"{ObjectKind.ToString()}#{DataId} - {SubKind}";

                if (Name.Length >= 1)
                {
                    stringRep += $" - {Name}";
                }
                break;
            }

            return(stringRep + $"({ActorID:X})");
        }
Exemplo n.º 4
0
        public static EndBlockRecord CreateEndBlock(ObjectKind objectKind)
        {
            EndBlockRecord record = new EndBlockRecord();

            record.ObjectKind = objectKind;
            return(record);
        }
Exemplo n.º 5
0
    public ObjectRepresentation CheckIntersect(ObjectRepresentation obj, ObjectKind allowedKinds, float margin = 0f, bool aboveLaneMatters = true)
    {
        // TODO Broadphase optimization here

        foreach (ObjectRepresentation other in objects)
        {
            if ((other.kind & allowedKinds) == 0)
            {
                continue;
            }
            if (aboveLaneMatters && obj.location.isAboveLane != other.location.isAboveLane)
            {
                continue;
            }
            if (!CommonLanes(obj.location, other.location))
            {
                continue;
            }

            if (obj.location.bounds.Intersects(other.location.bounds, margin))
            {
                return(other);
            }
        }

        return(null);
    }
Exemplo n.º 6
0
 public NodeData(NodeData parent, object data, string objectName, ObjectKind kind)
 {
     _data           = data;
     _kind           = kind;
     _parent         = parent;
     this.objectName = objectName;
 }
Exemplo n.º 7
0
    void exp_marble_Spawn()
    {
        float      marble_num  = Random.value;
        ObjectKind marble_type = ObjectKind.exp_marble_small;

        if (marble_num < 0.1f)
        {
            marble_type = ObjectKind.exp_marble_large;
        }
        else if (marble_num < 0.3f)
        {
            marble_type = ObjectKind.exp_marble_middle;
        }
        else
        {
            marble_type = ObjectKind.exp_marble_small;
        }

        exp_marble = ObjectPoolingManager.instance.GetQueue(marble_type);
        exp_marble.GetComponent <Item>().player = player;
        float X = Random.Range(player.position.x - range, player.position.x + range);
        float Y = Random.Range(player.position.y - range, player.position.y + range);

        exp_marble.transform.position = new Vector3(X, Y, 0);
        Invoke("exp_marble_Spawn", spawn_time);
    }
Exemplo n.º 8
0
 //public UInt64 size;
 public TransFileObject(string fname, string objid, DateTime updatetime, ObjectKind kind)
 {
     this.fileName   = fname;
     this.objId      = objid;
     this.updateTime = updatetime;
     this.kind       = kind;
 }
Exemplo n.º 9
0
 public static Object Create(ObjectKind kind, object value)
 {
     return(new Object
     {
         Kind = kind,
         Value = value
     });
 }
Exemplo n.º 10
0
 private void LogCancellation(ObjectKind objectKind, ActivityKind activityKind, Dictionary <string, object> data,
                              SPWeb spWeb,
                              ProcessActivityEventArgs args)
 {
     if (!string.IsNullOrEmpty(args.CancellationMessage))
     {
         _logger.Log(objectKind, activityKind, data, spWeb, args.CancellationMessage);
     }
 }
Exemplo n.º 11
0
        public static StartBlockRecord CreateStartBlock(ObjectKind objectKind, short objectContext,
                                                        short objectInstance1, short objectInstance2)
        {
            StartBlockRecord record = new StartBlockRecord();

            record.ObjectKind      = objectKind;
            record.ObjectContext   = objectContext;
            record.ObjectInstance1 = objectInstance1;
            record.ObjectInstance2 = objectInstance2;
            return(record);
        }
    protected virtual void Start()
    {
        //Assert.AreNotEqual(ObjectKind.Unassigned, objectKind, $"`objectKind` was not set for {this}. Please assign in the inspector.");
        // TEMP. Use old system for determining type while transitioning away from the old system.
        if (objectKind == ObjectKind.Unassigned)
        {
            objectKind = GetKindBasedOnGameObjectTag();
        }

        LevelState.instance.Add(MakeRepresentation());
    }
Exemplo n.º 13
0
 public bool Contains(ObjectKind objectKind)
 {
     foreach (StartBlockRecord item in blockList)
     {
         if (item.ObjectKind == objectKind)
         {
             return(true);
         }
     }
     return(false);
 }
Exemplo n.º 14
0
        public void Read(Stream inputStream)
        {
            //custom font atlas file
            AtlasList = new List <SimpleBitmapAtlas>();
            using (BinaryReader reader = new BinaryReader(inputStream, System.Text.Encoding.UTF8))
            {
                //1. version
                ushort fileversion = reader.ReadUInt16();
                bool   stop        = false;
                int    listCount   = 0;

                while (!stop)
                {
                    //2. read object kind
                    ObjectKind objKind = (ObjectKind)reader.ReadUInt16();
                    switch (objKind)
                    {
                    default: throw new NotSupportedException();

                    case ObjectKind.OverviewMultiSizeFontInfo:
                        listCount = reader.ReadUInt16();
                        break;

                    case ObjectKind.OverviewFontInfo:
                        //start new atlas
                        _atlas = new SimpleBitmapAtlas();
                        AtlasList.Add(_atlas);
                        ReadOverviewFontInfo(reader);
                        break;

                    case ObjectKind.FontScriptTags:
                        ReadScriptTags(reader);
                        break;

                    case ObjectKind.End:
                        stop = true;
                        break;

                    case ObjectKind.GlyphList:
                        ReadAtlasItems(reader);
                        break;

                    case ObjectKind.TotalImageInfo:
                        ReadTotalImageInfo(reader);
                        break;

                    case ObjectKind.ImgUrlDic:
                        ReadImgUrlDict(reader);
                        break;
                    }
                }
            }
        }
 public ProcessActivityEventArgs(ObjectKind objectKind, ActivityKind activityKind,
                                 Dictionary <string, object> data, SPWeb contextWeb,
                                 StreamManager streamManager, ThreadManager threadManager, ActivityManager activityManager)
 {
     _objectKind      = objectKind;
     _activityKind    = activityKind;
     _data            = data;
     _contextWeb      = contextWeb;
     _streamManager   = streamManager;
     _threadManager   = threadManager;
     _activityManager = activityManager;
 }
Exemplo n.º 16
0
        private Rect Kind(Rect container)
        {
            Rect output = Rect.zero;

            UtilityGUI.Container(container, Color.black, 0.7f.Grey(), 1, 6, (kindContainer) =>
            {
                // Set the rectangle for the scopes label
                var kindRectLabel   = kindContainer;
                kindRectLabel.width = 60;

                // Set the rectangle for the scopes control
                var _kindRect   = kindContainer;
                _kindRect.x    += 60;
                _kindRect.width = (kindContainer.width / 2) - 64;

                ObjectKind _kind = (ObjectKind)kind.value;

                Texture2D kindIcon = null;

                switch (_kind)
                {
                case ObjectKind.Class:
                    kindIcon = UAliveResources.@class;
                    break;

                case ObjectKind.Struct:
                    kindIcon = UAliveResources.@struct;
                    break;

                case ObjectKind.Interface:
                    kindIcon = UAliveResources.@interface;
                    break;

                case ObjectKind.Enum:
                    kindIcon = UAliveResources.@enum;
                    break;

                case ObjectKind.Event:
                    kindIcon = UAliveResources.@event;
                    break;
                }

                GUI.Label(kindRectLabel, new GUIContent("Kind"));
                Graphics.DrawTexture(new Rect(kindRectLabel.x + 40, kindRectLabel.y, 16, 16), kindIcon);

                // Draw the special control
                LudiqGUI.Inspector(kind, _kindRect, GUIContent.none);

                output = _kindRect;
            });

            return(output);
        }
Exemplo n.º 17
0
        public string GetName(ObjectKind kind, int id)
        {
            switch (kind)
            {
            case ObjectKind.Weapon:         return(BDatabaseBase.TryGetNameWithUndefined(Weapons, id));

            //case ObjectKind.TacticState:return BDatabaseBase.TryGetNameWithUndefined(TacticStates, id);
            case ObjectKind.Action:         return(BDatabaseBase.TryGetNameWithUndefined(Actions, id));

            default: throw new Debug.UnreachableException(kind.ToString());
            }
        }
Exemplo n.º 18
0
        public int GetId(ObjectKind kind, string name)
        {
            switch (kind)
            {
            case ObjectKind.Weapon:                 return(BDatabaseBase.TryGetIdWithUndefined(m_dbiWeapons, name, Weapons));

            //case ObjectKind.TacticState:	return BDatabaseBase.TryGetIdWithUndefined(m_dbiTacticStates, name, TacticStates);
            case ObjectKind.Action:                 return(BDatabaseBase.TryGetIdWithUndefined(m_dbiActions, name, Actions));

            default: throw new Debug.UnreachableException(kind.ToString());
            }
        }
Exemplo n.º 19
0
        // Private Methods (1) 

        private void OnValidateActivity(ProcessActivityEventArgs args)
        {
            var validObjectKinds = new ObjectKind[] {};

            if (validObjectKinds.Contains(args.ObjectKind) ||
                args.ContextWeb.CurrentUser.ID != args.ContextWeb.Site.SystemAccount.ID)
            {
                return;
            }

            args.Cancel = true;
            args.CancellationMessage = "Ignoring activities performed by the System Account";
        }
Exemplo n.º 20
0
        public static ObjectMacro GetMacro(string name, ObjectKind kind)
        {
            switch (kind)
            {
            case ObjectKind.Class:

                IEnumerable <ObjectMacro> macros = UnityEngine.Resources.FindObjectsOfTypeAll <ObjectMacro>();
                macros = Classes(macros);
                return(macros.Where((macro) => { return macro.name == name; }).Single());
            }

            return(null);
        }
Exemplo n.º 21
0
        private static ObjectKind CheckDateTimeKind(ObjectKind kind)
        {
            switch (kind)
            {
            case ObjectKind.OffsetDateTime:
            case ObjectKind.LocalDateTime:
            case ObjectKind.LocalDate:
            case ObjectKind.LocalTime:
                return(kind);

            default:
                throw new ArgumentOutOfRangeException(nameof(kind), kind, null);
            }
        }
Exemplo n.º 22
0
        public EndBlockRecord(RecordInputStream in1)
        {
            rt = in1.ReadShort();
            grbitFrt = in1.ReadShort();
            ObjectKind = (ObjectKind) in1.ReadShort();
            // Often, but not always has 6 unused bytes at the end
		    if(in1.Available() == 0) {
			    unused = new byte[0];
		    } else {
			    unused = new byte[6];
			    in1.ReadFully(unused);
		    }

        }
Exemplo n.º 23
0
        internal bool StreamXmlForID(KSoft.IO.XmlElementStream s, FA mode, string xml_name, ref int dbid,
                                     ObjectKind kind,
                                     bool is_optional = true, XmlNodeType xml_source = XML.Util.kSourceElement)
        {
            Contract.Requires(KSoft.IO.XmlElementStream.StreamSourceIsValid(xml_source));
            Contract.Requires(KSoft.IO.XmlElementStream.StreamSourceRequiresName(xml_source) == (xml_name != null));

            string id_name      = null;
            bool   was_streamed = true;
            bool   to_lower     = false;

            if (mode == FA.Read)
            {
                if (is_optional)
                {
                    was_streamed = XML.Util.StreamInternStringOpt(s, mode, xml_name, ref id_name, to_lower, xml_source);
                }
                else
                {
                    XML.Util.StreamInternString(s, mode, xml_name, ref id_name, to_lower, xml_source);
                }

                if (was_streamed)
                {
                    dbid = GetId(kind, id_name);
                    Contract.Assert(dbid != Util.kInvalidInt32);
                }
                else
                {
                    dbid = Util.kInvalidInt32;
                }
            }
            else if (mode == FA.Write && dbid != Util.kInvalidInt32)
            {
                id_name = GetName(kind, dbid);
                Contract.Assert(!string.IsNullOrEmpty(id_name));

                if (is_optional)
                {
                    XML.Util.StreamInternStringOpt(s, mode, xml_name, ref id_name, to_lower, xml_source);
                }
                else
                {
                    XML.Util.StreamInternString(s, mode, xml_name, ref id_name, to_lower, xml_source);
                }
            }

            return(was_streamed);
        }
Exemplo n.º 24
0
 public PartyMember(ActorTable table, Structs.PartyMember rawData)
 {
     CharacterName = Marshal.PtrToStringAnsi(rawData.namePtr);
     Unknown       = rawData.unknown;
     Actor         = null;
     for (var i = 0; i < table.Length; i++)
     {
         if (table[i] != null && table[i].ActorId == rawData.actorId)
         {
             Actor = table[i];
             break;
         }
     }
     ObjectKind = rawData.objectKind;
 }
Exemplo n.º 25
0
        public EndBlock(IStreamReader reader, GraphRecordNumber id, ushort length)
            : base(reader, id, length)
        {
            // assert that the correct record type is instantiated
            Debug.Assert(this.Id == ID);

            // initialize class members from stream
            this.frtHeaderOld = new FrtHeaderOld(reader);
            this.iObjectKind  = (ObjectKind)reader.ReadUInt16();

            reader.ReadBytes(6);

            // assert that the correct number of bytes has been read from the stream
            Debug.Assert(this.Offset + this.Length == this.Reader.BaseStream.Position);
        }
Exemplo n.º 26
0
 public EndBlockRecord(RecordInputStream in1)
 {
     rt         = in1.ReadShort();
     grbitFrt   = in1.ReadShort();
     ObjectKind = (ObjectKind)in1.ReadShort();
     // Often, but not always has 6 unused bytes at the end
     if (in1.Available() == 0)
     {
         unused = new byte[0];
     }
     else
     {
         unused = new byte[6];
         in1.ReadFully(unused);
     }
 }
Exemplo n.º 27
0
        public void Read(Stream inputStream)
        {
            //custom font atlas file
            _atlas = new SimpleBitmaptAtlas();
            using (BinaryReader reader = new BinaryReader(inputStream, System.Text.Encoding.UTF8))
            {
                //1. version
                ushort fileversion = reader.ReadUInt16();
                bool   stop        = false;
                while (!stop)
                {
                    //2. read object kind
                    ObjectKind objKind = (ObjectKind)reader.ReadUInt16();
                    switch (objKind)
                    {
                    default: throw new NotSupportedException();

                    case ObjectKind.OverviewBitmapInfo:
                        ReadOverviewBitmapInfo(reader);
                        break;

                    case ObjectKind.OverviewFontInfo:
                        //ReadOverviewFontInfo(reader);
                        throw new NotSupportedException();

                    case ObjectKind.End:
                        stop = true;
                        break;

                    case ObjectKind.GlyphList:
                        ReadGlyphList(reader);
                        break;

                    case ObjectKind.TotalImageInfo:
                        ReadTotalImageInfo(reader);
                        break;

                    case ObjectKind.ImgUrlDic:
                        ReadImgUrlDict(reader);
                        break;
                    }
                }
            }
        }
        public bool ActivityExists(ObjectKind objectKind, ActivityKind activityKind,
                                   Guid webId, Guid?listId, int?itemId, string activityKey)
        {
            string sql = @"SELECT COUNT(dbo.SS_Activities.Id) AS Total FROM dbo.SS_Activities
                                    INNER JOIN dbo.SS_Threads ON dbo.SS_Activities.ThreadId = dbo.SS_Threads.Id
                                    GROUP BY dbo.SS_Threads.Kind, dbo.SS_Activities.Kind, dbo.SS_Threads.WebId, 
                                             dbo.SS_Threads.ListId, dbo.SS_Threads.ItemId, dbo.SS_Activities.ActivityKey
                                    HAVING (dbo.SS_Threads.Kind = @ObjectKind) AND (dbo.SS_Activities.Kind = @ActivityKind)
                                       AND (dbo.SS_Threads.WebId = @WebId) AND (dbo.SS_Threads.ListId = @ListId) 
                                       AND (dbo.SS_Threads.ItemId = @ItemId) AND (dbo.SS_Activities.ActivityKey = @Key)";

            if (!listId.HasValue)
            {
                sql = sql.Replace("= @ListId", "IS NULL");
            }
            if (!itemId.HasValue)
            {
                sql = sql.Replace("= @ItemId", "IS NULL");
            }
            if (string.IsNullOrEmpty(activityKey))
            {
                sql = sql.Replace("= @Key", "IS NULL");
            }

            using (SqlCommand sqlCommand = GetSqlCommand(sql))
            {
                sqlCommand.Parameters.AddWithValue("@ObjectKind", objectKind);
                sqlCommand.Parameters.AddWithValue("@ActivityKind", activityKind);
                sqlCommand.Parameters.AddWithValue("@WebId", webId);
                sqlCommand.Parameters.AddWithValue("@ListId", listId.HasValue ? (object)listId : DBNull.Value);
                sqlCommand.Parameters.AddWithValue("@ItemId", itemId.HasValue ? (object)itemId : DBNull.Value);
                sqlCommand.Parameters.AddWithValue("@Key",
                                                   string.IsNullOrEmpty(activityKey) ? DBNull.Value : (object)activityKey);

                object activityCount = sqlCommand.ExecuteScalar();

                if (activityCount == null || activityCount == DBNull.Value)
                {
                    return(false);
                }
                return((int)activityCount > 0);
            }
        }
Exemplo n.º 29
0
 public SymbolMetadata(
     string unifiedId,
     string?hash,
     string path,
     ObjectKind objectKind,
     string name,
     Architecture arch,
     FileFormat fileFormat,
     ConcurrentDictionary <Guid, object?> batchIds)
 {
     UnifiedId  = unifiedId;
     Hash       = hash;
     Path       = path;
     ObjectKind = objectKind;
     Name       = name;
     Arch       = arch;
     FileFormat = fileFormat;
     BatchIds   = batchIds;
 }
Exemplo n.º 30
0
 public ObjectFileResult(
     string debugId,
     string codeId,
     string path,
     string hash,
     BuildIdType buildIdType,
     ObjectKind objectKind,
     FileFormat fileFormat,
     Architecture architecture)
 {
     DebugId      = debugId;
     CodeId       = codeId;
     Path         = path;
     Hash         = hash;
     BuildIdType  = buildIdType;
     ObjectKind   = objectKind;
     FileFormat   = fileFormat;
     Architecture = architecture;
 }
Exemplo n.º 31
0
        /// <summary>
        /// 플레이어 셋팅하는 함수
        /// </summary>
        protected virtual void PlayerSetting(ILog log)
        {
            Name = gameObject.name;     // 이름은 나중에 바꿔도 됨
            Kind = ObjectKind.Player;

            MyStats = new Stats();

            playerKeys.Add("MoveL", new KeySetting(KeyCode.LeftArrow, IdleEvent));
            playerKeys.Add("MoveR", new KeySetting(KeyCode.RightArrow, IdleEvent));

            playerKeys.Add("Attack", new KeySetting(KeyCode.Z, AttackEvent));
            playerKeys.Add("SpecialAttack", new KeySetting(KeyCode.X, SpecialAttackEvent));

            playerKeys.Add("Jump1", new KeySetting(KeyCode.C, JumpEvent));
            playerKeys.Add("Jump2", new KeySetting(KeyCode.Space, JumpEvent));
            playerKeys.Add("Jump3", new KeySetting(KeyCode.UpArrow, JumpEvent));

            playerKeys.Add("Option", new KeySetting(KeyCode.Escape, OptionEvent));
        }
Exemplo n.º 32
0
 public static StartBlockRecord CreateStartBlock(ObjectKind objectKind)
 {
     return CreateStartBlock(objectKind, 0, 0, 0);
 }
Exemplo n.º 33
0
 public static StartBlockRecord CreateStartBlock(ObjectKind objectKind, short objectContext,
     short objectInstance1)
 {
     return CreateStartBlock(objectKind, objectContext, objectInstance1, 0);
 }
Exemplo n.º 34
0
 public static StartBlockRecord CreateStartBlock(ObjectKind objectKind, short objectContext,
     short objectInstance1, short objectInstance2)
 {
     StartBlockRecord record = new StartBlockRecord();
     record.ObjectKind = objectKind;
     record.ObjectContext = objectContext;
     record.ObjectInstance1 = objectInstance1;
     record.ObjectInstance2 = objectInstance2;
     return record;
 }
Exemplo n.º 35
0
 public static EndBlockRecord CreateEndBlock(ObjectKind objectKind)
 {
     EndBlockRecord record = new EndBlockRecord();
     record.ObjectKind = objectKind;
     return record;
 }
Exemplo n.º 36
0
 public NodeData(NodeData parent, object data, string objectName, ObjectKind kind)
 {
     _data = data;
     _kind = kind;
     _parent = parent;
     this.objectName = objectName;
 }